Formatting, text editor options

Use the Formatting dialog box in Visual Studio to control how your Synergy/DE code is indented. You can select one of the two preset formatting schemes, or you can customize the formatting settings. Code will be formatted as you type, when it is pasted in, and when you run the document formatting option (Edit > Advanced > Format Document).

To access the Formatting dialog box, select Tools > Options, and then select Text Editor > Synergy DBL > Formatting in the navigation pane of the Options dialog box.

Note

The size of indents is determined by the Indent size setting in the Tabs dialog box. In order for code to be formatted as you type, the Indenting option in the Tabs dialog must be set to Smart. If it is set to None or Block, code will not be formatted as you type, but will be formatted when you run the Format Document option.

To select a formatting scheme:

Choose Style 1 or Style 2. The sample code pane changes to show the differences between the two styles.

To customize the formatting:

Select options from the categories in the scrolling pane. The sample code pane changes to show the effects of your selections. When you click OK, the formatting selections will be saved.

Note

Reselecting Style 1 or Style 2 will undo your customizations and return to the preset style!

Comments

Indent as statements Comments are indented following the same rules as statements. (Statements are indented following the rules for basic blocks.)
Leave first column alone A comment starting in the first column (i.e., all the way at the left margin) will not be indented.

Code line comment indentation (on document reformat)

This option is used only when the Format Document option is run. It does not affect code as it is typed.

Indent to fixed column number Indents code-line comments (comments on lines with code) to the specified column. If the specified column occurs before the end of the code on that line, the comment on that line is not indented.

Basic Blocks

No indentation in block Contents of the block are left-aligned.
Indent contents of block Contents of the block are indented.

Routines

No indentation in block Contents of the block are aligned with the routine.
Indent contents of block Contents of the block are indented.
Leave data div alone The data division (except param definitions) is aligned with the routine.
Leave param div alone Param definitions are aligned with the routine.

Labels

Indent as statements Labels are indented following the same rules as statements. (Statements are indented following the rules for basic blocks.)
Align to first column Labels are aligned all the way to the left margin.
Align to containing routine Labels are aligned with the routine in which they are located.

Lone Begin/End Block

A lone begin/end block is one that is not contained within another begin/end block or a conditional block. It may, however, have another begin/end block within it.

Align contents to begin Contents of the block are aligned with the begin for that block.
Indent one level Contents of the block are indented one level.

Conditional Blocks

Align begin/end to block A begin/end within a conditional block is aligned with the preceding conditional rather than indented.
Align begin/end to contents A begin/end within a conditional block is aligned with the content of the block.

Data division alignment (on document reformat)

These options are used only when the Format Document option is run. They do not affect code as it is typed.

Align data field elements Aligns field definition elements (field name, data type, initial value) so that elements of the same type start on the same column. For example, field names will be indented so that they all start on the same column. See the examples below.
Next to variable Positions each comma next to the element that precedes it in a field definition. For example, if you have these field definitions
in opt arg1 , a20 ,  "some text"
in opt argTwo  ,  a100      ,"more text"

they become

in opt arg1,        a20,     "some text"
in opt argTwo,      a100,    "more text"
Next to data type Positions each comma next to the element that follows it in a field definition. For example, if you have these field definitions
in opt arg1 , a20 ,  "some text"
in opt argTwo  ,  a100      ,"more text"

they become

in opt arg1        ,a20    ,"some text"
in opt argTwo      ,a100   ,"more text"
Tab stops between elements Specifies the number of tab stops between data field elements.

Directives

Indent as statements Compiler directives are indented following the same rules as statements. (Statements are indented following the rules for basic blocks.)
Align to first column Compiler directives are aligned all the way to the left margin.
Indent .include .INCLUDE directives are indented, but other compiler directives are aligned all the way to the left margin.

Continuation Characters

Align to containing statement Continuation characters are aligned with the statement they apply to.
Align to first column Continuation characters are aligned all the way to the left margin.