Admin Production ni-theme
Current Publication

Source Code Formatting Options

LabWindows/CVI

Formatting Options Dialog Box

The Formatting Options button in the Editor Preferences dialog box opens the Formatting Options dialog box. The coding format styles you select in this dialog box affect code that you generate using Edit»Insert Construct or Code»Generate and that you format using Edit»Format Selection and Edit»Format File.

This dialog box is unavailable if you enable Use CVI legacy formatting in the Editor Preferences dialog box.

This dialog box contains the following options:

  • Bracket Style—Specify the location of curly brackets. The auto indent feature uses this setting to determine proper indentation.

    You can specify the following styles:

    • Allman
    • Java
    • Kernighan & Ritchie
    • Whitesmith
    • Banner
    • 1TBS
  • Indent—Determine which of the following elements to indent:

    • Switch—Indent the case statements within a switch statement.
    • Case—Indent the case statement in relation to the case header. LabWindows/CVI does not indent case statements without enclosing brackets.
    • Labels—Indent labels one indentation level less than the current indentation level instead of being flushed left.
    • Preprocessor—Indent multiline preprocessor definitions that end with a backslash.
    • Comments—Indent C++ style comments that begin in the first column.
  • Miscellaneous—Specify the following options:

    • Break closing brackets—Break statements from the immediately preceding closing brackets.
    • Break headers—Break one-line statements from the corresponding header.
    • Align pointers—Align the pointer or reference operator to the data type, the variable name, or the space between the data type and variable name. You also can select Do not change to prevent LabWindows/CVI from automatically updating the alignment.

The Formatting Options dialog box contains a preview pane that updates the sample code based on the options you select.