Jump to content

Using #Region


dinodod
 Share

Recommended Posts

Just curious, does #region do anything useful or does it simply 'group' blocks of code for easier reading? I'm using comments in my code and was wondering what method I could use that would be best for adding comments to my code about blocks of code. I see uses for #region but I grew up since the days of DOS 1.0 and always used comments in my code.

Is there another way that is preferred?

Thanks.

Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007

Link to comment
Share on other sites

If you have large blocks of code, you can use #region/#endregion along with SciTE's code folding to hide sections or regions of you code to make scrolling easier.

I like the code folding in SCITE. Very nice option. But for me, it doesn't keep the folds after I close the file. I also have another issue with the folds. I need to customize what it sees to fold. It like to fold all sorts of things but I want to trim the fat from the fold :) and have a select list of things to have it fold.

Any thoughts on that?

Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007

Link to comment
Share on other sites

  • Developers

I like the code folding in SCITE. Very nice option. But for me, it doesn't keep the folds after I close the file. I also have another issue with the folds. I need to customize what it sees to fold. It like to fold all sorts of things but I want to trim the fat from the fold :) and have a select list of things to have it fold.

Any thoughts on that?

SciTE doesn't remember the last folding state, only thing you can do is set the initial folding state of all folds.

Have no idea what you mean with the rest of your post .... "sees to fold" , "trim the fat from the fold " ?

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

What I meant is that if you look at the folds in SCITE, it 'sees' a lot of pieces that it wants to be able t fold. For instance, it reconizes CASE statements and makes a option to fold it. I do not want it to 'see' CASE statements as an option to fold (Hence trimming the fold :))

And yes, I have thus far alone in the beginning of my project over 350 lines of UDF's and rapidly growing :D

Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007

Link to comment
Share on other sites

  • Developers

What I meant is that if you look at the folds in SCITE, it 'sees' a lot of pieces that it wants to be able t fold. For instance, it reconizes CASE statements and makes a option to fold it. I do not want it to 'see' CASE statements as an option to fold (Hence trimming the fold :))

Still don't understand the Folding issue...

Yes it does recognise each If-endif select-case-endselect etc as folding points but it is up to you to fold on it.

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Still don't understand the Folding issue...

Yes it does recognise each If-endif select-case-endselect etc as folding points but it is up to you to fold on it.

That is what I do not want it to reconize. I only want it to reconize #Region, not Select or some other commands. I don't want Select to have an option to fold. basically, I want to have it skipped. As I look at the folds, it becomes very cumberson to use since it 'see' so many things it wants to allow you to fold. I need to implify it.

Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007

Link to comment
Share on other sites

  • Developers

That is what I do not want it to reconize. I only want it to reconize #Region, not Select or some other commands. I don't want Select to have an option to fold. basically, I want to have it skipped. As I look at the folds, it becomes very cumberson to use since it 'see' so many things it wants to allow you to fold. I need to implify it.

No options for that other than to write your own lexer version, but I wouldn't want it like that.

It makes it easier to read the code in my opinion . :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...