Author Topic: [SOLVED]Custom Outlining  (Read 5501 times)

Offline jaxxa

  • Single posting newcomer
  • *
  • Posts: 4
[SOLVED]Custom Outlining
« 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
« Last Edit: March 05, 2009, 10:00:58 am by jaxxa »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Custom Outlining
« Reply #1 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...?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline jaxxa

  • Single posting newcomer
  • *
  • Posts: 4
Re: Custom Outlining
« Reply #2 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?

Offline nanyu

  • Almost regular
  • **
  • Posts: 188
  • nanyu
Re: Custom Outlining
« Reply #3 on: March 05, 2009, 02:43:51 am »
you can get it :

#if 1 //Test for region

//code


#endif

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


[attachment deleted by admin]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Custom Outlining
« Reply #4 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".

Offline jaxxa

  • Single posting newcomer
  • *
  • Posts: 4
Re: Custom Outlining
« Reply #5 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