Define a collapsible segment in a Structured Text routine
Outlining organizes a Structured Text routine into collapsible segments. Use automatic outlining to automatically define collapsible segments, or define collapsible segments using the #region and #endregion keywords.
To use outlining constructs:
- At the start of the first line in the segment, enter a beginning construct, such as#region. The following constructs are supported:
- if. . .end_if
- case. . .end_case
- for. . .end_for
- while. . .end_while
- Repeat. . .end_repeat
- #region. . .#endregion
- /*. . .*/for multi-line comments
- (*. . . *) for multi-line comments
- At the start of the last line in the segment, enter the ending construct, such as#endregion.The following example shows a simple segment:To navigate between associated matching keywords for the keyword at the cursor location, selectSearch > Matching Keyword, or pressCtrl+].TIP:The#region . . . #endregionconstruct does not execute, so it can precede an SBR instruction at the beginning of a routine.
TIP:
The
#region . . . #endregion
construct can be used as part of a statement within a built-in construct, such as a CASE_OF statement. The following example shows the #region . . . #endregion
construct in a CASE_OF statement, with regions expanded and collapsed:Provide Feedback