Previous Topic Next topic Print topic


Indentation

You can specify some preferences for how lines indent in the editor on the Indentation page in Tools > Options > Text Editor > Micro Focus COBOL.
Statement continuation indent size
Specify the size of the indent when you press Enter at the end of an incomplete statement.

For example, let's look at a statement, move A to B, and Statement continuation indent size is 2. If you indent this statement immediately after the first variable, A, this creates a new line that is indented by 2 spaces from the start of the original statement:

move A
  to B

Indent reference
Specify how lines will indent within an IF or a PERFORM construct.
Start of Container
Pressing Enter at the end of a statement within the construct creates a new line that has the same indent from the start of the container as specified by the Indent size setting on Tools > Options > Text Editor > Micro Focus COBOL > Tabs.
For example, let's assume that the Indent size is 4 and that you have the following IF construct:
if x = y + z
end-if

Pressing Enter at the end of the first line creates a new line that is indented by 4 spaces from the start of the IF statement:

if x = y + z
    display
end-if
Continuation Indent
If there are continuation lines in the code, this specifies that any line you indent in the code within the construct will indent from the start of the last line of the continuation statement.
For example, let's take a look at the same example but slightly modified so the first line is indented to create a continuation line:
if x
              = y + z
end-if

Pressing Enter at the end of the continuation line creates a new line which is indented by 4 spaces from the beginning of the continuation line:

if x
              = y + z
                  *position of cursor after indentation
end-if
Previous Topic Next topic Print topic