Author Topic: [Tutorial] Using Regions in your Scriptcode  (Read 9753 times)

0 Members and 1 Guest are viewing this topic.

Offline Crome969Topic starter

  • Moderator
  • *
  • *****
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +559
  • Referrals: 10
    • View Profile
    • ScriptSDK
[Tutorial] Using Regions in your Scriptcode
« on: January 03, 2013, 03:33:04 AM »
0
Today i want to show you a small way to add some better view to your code.
I often camed to the situation were i wroted some hundred lines of code and lost the trace wich file contains what and were in my script code is what function.
Some of you may used C# and know it when try to sort code into Regions to use the folder view\close to hide or see code.
This works in Pascal Script as well.


This Picture shows a sample of one of my Units , were dozen of Code is displayed (Nearly 1000 Lines of Code in 1 File )

You may coming in same Situation and think -> "Okay were is my Procedure XY"



The second Picture shows when i used Regions and folded Code...


So how it works?

First we need to declare where a Region Start by adding  
Code: [Select]
{$Region Tutorial}.
The Name Tutorial can be replaced with any kind of Text you like to describe the region.

Then we need to declare where a Region Ends by adding
Code: [Select]
{$Endregion}
You can pack Regions into Regions, Stealth Editor will display the region folding when right applied..

Sample :




Hope this will help you designing Pascal Scripts :)

Offline dxrom

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +277
  • Referrals: 1
    • View Profile
Re: [Tutorial] Using Regions in your Scriptcode
« Reply #1 on: January 03, 2013, 06:19:52 AM »
0
Like C#

#region xxx

#endregion



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Offline KaliOfLS

  • That's "Dr." Kali to you!
  • Sr. Member
  • *
  • Posts: 406
  • Activity:
    0%
  • Reputation Power: 6
  • KaliOfLS has no influence.
  • Gender: Male
  • Respect: +61
  • Referrals: 2
    • View Profile
Re: [Tutorial] Using Regions in your Scriptcode
« Reply #2 on: January 03, 2013, 06:24:27 AM »
0
Now how do we do that in oEUO/lua?
R~~~~ B~~~~~~~~ 
^ real life signature for sure

Offline Crome969Topic starter

  • Moderator
  • *
  • *****
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +559
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: [Tutorial] Using Regions in your Scriptcode
« Reply #3 on: January 03, 2013, 07:16:05 AM »
0
Now how do we do that in oEUO/lua?
Please check the Thread Section.
This Subforum is Talk about the StealthClient ( Support Pascal and Python )

Offline Boydon

  • Moderator
  • **
  • *****
  • Posts: 76
  • Activity:
    0%
  • Reputation Power: 3
  • Boydon has no influence.
  • Respect: +29
  • Referrals: 0
    • View Profile
Re: [Tutorial] Using Regions in your Scriptcode
« Reply #4 on: January 04, 2013, 01:17:35 AM »
0
Like C#

#region xxx

#endregion

The chief architect of C# is the creator of Delphi. ;)

Anyway I think that regions sometime may clutter your code. Another tool that i like to use to fast browse my code is the function tree in the hint window of stealth.


View Screen Capture
Member of the Stealth development team.

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +90
  • Referrals: 0
    • View Profile
Re: [Tutorial] Using Regions in your Scriptcode
« Reply #5 on: January 04, 2013, 01:27:28 AM »
0
Or just use notepad++ )
What you witness -- is whatver..
uogamers hybrid.

Offline Boydon

  • Moderator
  • **
  • *****
  • Posts: 76
  • Activity:
    0%
  • Reputation Power: 3
  • Boydon has no influence.
  • Respect: +29
  • Referrals: 0
    • View Profile
Re: [Tutorial] Using Regions in your Scriptcode
« Reply #6 on: January 04, 2013, 01:52:10 AM »
0
If you work in Python you want to use Notepad++ for sure, but if you work in Pascal Script then Stealth has some very nice built in features that notepad++ does not have (autocomplete, argument hints, integrated debbuging, etc...).
Member of the Stealth development team.

Offline KaliOfLS

  • That's "Dr." Kali to you!
  • Sr. Member
  • *
  • Posts: 406
  • Activity:
    0%
  • Reputation Power: 6
  • KaliOfLS has no influence.
  • Gender: Male
  • Respect: +61
  • Referrals: 2
    • View Profile
Re: [Tutorial] Using Regions in your Scriptcode
« Reply #7 on: January 04, 2013, 06:49:13 AM »
0
Now how do we do that in oEUO/lua?
Please check the Thread Section.
This Subforum is Talk about the StealthClient ( Support Pascal and Python )

I know, I was making a joke :(

This is a nice feature and I wish I could do it in oEUO.  Hehe.
R~~~~ B~~~~~~~~ 
^ real life signature for sure

Offline Crome969Topic starter

  • Moderator
  • *
  • *****
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +559
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: [Tutorial] Using Regions in your Scriptcode
« Reply #8 on: January 04, 2013, 07:09:51 AM »
0
Now how do we do that in oEUO/lua?
Please check the Thread Section.
This Subforum is Talk about the StealthClient ( Support Pascal and Python )

I know, I was making a joke :(

This is a nice feature and I wish I could do it in oEUO.  Hehe.
I know how you feel, long ago i searched for the chance to write crazy scripts in euo, but saw its limits.. Then a new hope camed up, oeuo but disapointed due the fact it never really were finished.
I personally think if cheffe and his team would invest more time into project or he would finally release the sources or allow more people to work on it, a lot of beautiful possiblities could appear. Until that oeuo and euo is always known in public, but mere a joke behind the scene...

Tags: Stealth Pascal