LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way for CVI to automaticly format my code based on the "Bracket Styles" settings I have selected?

I am looking for more debugging oppertunities and I would like an automated way to format my code for my "standard" bracket styles based on the settings that I have selected. Would others be interested in this capability?

EXAMPLE, THIS:
int example(int test1, int test2)
{
if(test1 == test2)
{
if(test1 < 0)
return(-1);
else
return(0);
}
else
return(0);
}

WOULD CONVERT TO THIS:
int example(int test1, int test2)
{
if(test1 == test2)
{
if(test1 < 0)
return(-1);
else
return(1);
}
else
return(0);
}
0 Kudos
Message 1 of 5
(3,269 Views)
Whilst it would be a nice feature to have this within CVI, there are already plenty of C'/C++ Code Beautifiers' already freely available.
A quick search on Google or Dogpile will get you these.

I usually run my code through Lint and 'beautify'it as the last steps in a project.
It would be good and a small time saving if the IDE did this on the fly, but I don't know if I'd want it in the IDE.
Sometimes when performing merges of source, I do not always know where the source comes from or how it was formatted.

Perhaps it would be a good feature to have a 'beautifier' pluggin within CVI.

But, yes, I would be interested in having something there.

Chris
Message 2 of 5
(3,269 Views)
UltaEdit-32 http://www.ultaedit.com and
C Indent macro
by Oliver Tscherwitschke

"Randy_JCI" wrote in message
news:5065000000080000002F520000-1023576873000@exchange.ni.com...
> Is there a way for CVI to automaticly format my code based on the
> "Bracket Styles" settings I have selected?
>
> I am looking for more debugging oppertunities and I would like an
> automated way to format my code for my "standard" bracket styles based
> on the settings that I have selected. Would others be interested in
> this capability?
>
> EXAMPLE, THIS:
> int example(int test1, int test2)
> {
> if(test1 == test2)
> {
> if(test1 < 0)
> return(-1);
> else
> return(0);
> }
> else
> return(0);
> }
>
> WOULD CONVERT TO THIS:
> int example(int test
1, int test2)
> {
> if(test1 == test2)
> {
> if(test1 < 0)
> return(-1);
> else
> return(1);
> }
> else
> return(0);
> }
0 Kudos
Message 3 of 5
(3,269 Views)
UltraEdit at www.ultraedit.com
sorry pls.

"Ivaylo Iltchev" wrote in message
news:3d3c5131@newsgroups....
> UltaEdit-32 http://www.ultaedit.com and
> C Indent macro
> by Oliver Tscherwitschke
>
> "Randy_JCI" wrote in message
> news:5065000000080000002F520000-1023576873000@exchange.ni.com...
> > Is there a way for CVI to automaticly format my code based on the
> > "Bracket Styles" settings I have selected?
> >
> > I am looking for more debugging oppertunities and I would like an
> > automated way to format my code for my "standard" bracket styles based
> > on the settings that I have selected. Would others be interested in
> > this capability?
> >
> > EXAMPLE, THIS:
> > int example(int test1, int
test2)
> > {
> > if(test1 == test2)
> > {
> > if(test1 < 0)
> > return(-1);
> > else
> > return(0);
> > }
> > else
> > return(0);
> > }
> >
> > WOULD CONVERT TO THIS:
> > int example(int test1, int test2)
> > {
> > if(test1 == test2)
> > {
> > if(test1 < 0)
> > return(-1);
> > else
> > return(1);
> > }
> > else
> > return(0);
> > }
>
>
0 Kudos
Message 4 of 5
(3,269 Views)
Hello
I wonder why there are these c-style settings. What do they do?

Stephan

"Randy_JCI" schrieb im Newsbeitrag
news:5065000000080000002F520000-1023576873000@exchange.ni.com...
> Is there a way for CVI to automaticly format my code based on the
> "Bracket Styles" settings I have selected?
>
> I am looking for more debugging oppertunities and I would like an
> automated way to format my code for my "standard" bracket styles based
> on the settings that I have selected. Would others be interested in
> this capability?
>
> EXAMPLE, THIS:
> int example(int test1, int test2)
> {
> if(test1 == test2)
> {
> if(test1 < 0)
> return(-1);
> else
> return(0);
> }
> else
> return(0);
> }
>
> WOULD CONVERT TO THIS:
> int example(int test1, int test2)
> {

> if(test1 == test2)
> {
> if(test1 < 0)
> return(-1);
> else
> return(1);
> }
> else
> return(0);
> }
0 Kudos
Message 5 of 5
(3,269 Views)