News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

[SOLVED]Custom Outlining

Started by jaxxa, March 04, 2009, 04:52:41 AM

Previous topic - Next topic

jaxxa

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

MortenMacFly

Quote from: jaxxa on March 04, 2009, 04:52:41 AM
Somthing similar to VB.NET's #REGION
Do you mean something like:

//{ WHATEVER COMMENT
  ...your code...
//}

...which creates a collapsible region? Sorry if I misunderstood -> I don't know VB.NET's #REGION...?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

jaxxa

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?

nanyu

you can get it :

#if 1 //Test for region

//code


#endif

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


[attachment deleted by admin]

Jenna

Quote from: jaxxa on March 04, 2009, 10:34:50 PM
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.

Quote from: nanyu on March 05, 2009, 02:43:51 AM
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".

jaxxa

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