ScriptUO
Scripting Resources & Utilities => Stealth Client => Stealth archive => Topic started by: Crome969 on January 03, 2013, 03:33:04 AM
-
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.
(http://i.imagebanana.com/img/80lzggkn/unfoldedcode.png)
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"
(http://i.imagebanana.com/img/1bw1r3bz/foldedcode.png)
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 {$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 {$Endregion}
You can pack Regions into Regions, Stealth Editor will display the region folding when right applied..
Sample :
(http://i.imagebanana.com/img/futwdckc/subfolding.png)
Hope this will help you designing Pascal Scripts :)
-
Like C#
#region xxx
#endregion
-
Now how do we do that in oEUO/lua?
-
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 )
-
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.
(http://img204.imageshack.us/img204/9677/screenshotstudiocapturemj.png) (http://img204.imageshack.us/i/screenshotstudiocapturemj.png/)
View Screen Capture (http://img204.imageshack.us/i/screenshotstudiocapturemj.png/)
-
Or just use notepad++ )
-
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...).
-
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.
-
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...