Code::Blocks Forums

User forums => Help => Topic started by: jaxxa on March 04, 2009, 04:52:41 am

Title: [SOLVED]Custom Outlining
Post by: jaxxa on March 04, 2009, 04:52:41 am
Hi,
sorry if this is the wrong place to post this.

I was wondering if CodeBlocks had a feature Create custom outlining sections.

Somthing similar to VB.NET's #REGION
Title: Re: Custom Outlining
Post by: MortenMacFly on March 04, 2009, 09:17:57 am
Somthing similar to VB.NET's #REGION
Do you mean something like:
Code
//{ WHATEVER COMMENT
  ...your code...
//}
...which creates a collapsible region? Sorry if I misunderstood -> I don't know VB.NET's #REGION...?!
Title: Re: Custom Outlining
Post by: jaxxa on March 04, 2009, 10:34:50 pm
Yes that is what exactly I want.

However i just tried it and it does not seem to be working.
Just how it is with the // it seams to treat it as a comment seems to ignore the { and not create the collapsible box.

Then I remove the // and just have the "{" I get the collapsible box, that is what i want, but the program does not compile
"expected unqualified-id before '{' token"

Am I missing something? In there a setting that I need to change to enable this?
Title: Re: Custom Outlining
Post by: nanyu on March 05, 2009, 02:43:51 am
you can get it :

#if 1 //Test for region

//code


#endif

-------------------------


[attachment deleted by admin]
Title: Re: Custom Outlining
Post by: Jenna on March 05, 2009, 07:02:42 am
However i just tried it and it does not seem to be working.
Just how it is with the // it seams to treat it as a comment seems to ignore the { and not create the collapsible box.
...
Am I missing something? In there a setting that I need to change to enable this?

Make sure you have no space between the comment-slashes and the braces.

you can get it :

#if 1 //Test for region

//code


#endif

-------------------------


If that does not work out of the box, you have to check "Fold preprocessor commands" in "Settings -> Editor... -> Folding".
Title: Re: Custom Outlining
Post by: jaxxa on March 05, 2009, 10:00:26 am
Thanks for all the help 8)
Just tried that at TAFE and both methods seem to be working,
will try again when I get home and check if it was just a PEBKAC* error.

*Problem Exists Between Keyboard And Chair