From 11:00 PM CST Friday, Feb 14th - 6:30 PM CST Saturday, Feb 15th, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 11:00 PM CST Friday, Feb 14th - 6:30 PM CST Saturday, Feb 15th, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
The CVI Team would like to get an idea what the most commonly used source code editor bracket styles are. These options are currently available through Options >> Editor Preferences >> Bracket Styles. Please leave a comment on this page describing your preferred bracket styles. For example, the code snippet below is using Flush, Left for both Function Brackets and Statement Brackets:
void main ()
{
if (v > 0)
{
printf ("hello\n");
}
}
I use the Flush, Left for all bracket styles.
This is the one given as example in Jonathan's post above.
Cheers
My recommendation for default style in CVI: Flush Left for both function and statement brackets.
Personal preference: Uneven Left for both function and statement brackets.
Flush, Left (function and statement brackeks).
Flush Left for both function and statement brackets
Flush Right (function and statement brackets).
I use the FLUSH,LEFT for both statements & function blocks.
I also agree on the flush left. Personally I add a comment to every set so I can easily tell if one has been deleted or moved by mistake. I know you can use the balance option, but that will just tell you if you have the correct number of brackets, not if they were actually meant to match. IE
if (bGood)
{ // bgood
} // bgood
I use flush, left for both function brackets and statement brackets.
Uneven left (function and statement brackets).
Regards, Philippe
It would be great if CVI had a utility to automatically re-format the code with a single key combination according to our style of choice.
(Does it have that already?)
Flush, Left (function and statement brackeks).
Hi Eren,
this utility is missing but has been suggested in the LabWindows/CVI Idea Exchange: http://forums.ni.com/t5/LabWindows-CVI-Idea-Exchange/Auto-Indent-Code/idi-p/1777850 and is under consideration
Flush, Left (function and statement brackeks).
Hola:
Mi estilo de preferencia es el Flush, Left para todo el código. En lo personal por la claridad que brinda al leer el código.
I use Flush, Left for functions and Flush, Right for statements. However, I think Flush, Left for both is a fine default.
I am using Flush left for function definitions and Uneven left for statements: it permits me to easily detect where every single statement ends up even with several levels of nesting.
I use "Flush, Left" for function brackets and "Uneven, Left" for statements brackets.
Hi John
I guess I am the odd one out...
Flush Left on main...
Flush RIGHT on statements... I also comment the closing brackets
void main ()
{
if (v > 0)
{
printf ("hello\n");
} // end if v > 0 begin else
else
{
...
}// end else v <= 0
} // end main
is NI looking at making some mods to the editor... I definitely like the look and feel of the NotePad++ program if anyone has tried it in the C language style.
The interactive brackets highlights are nice as well as the alignment bars...
Reg
Chipb