Read-only code sections of AppBuilder-generated code
You can make the sections of the AppBuilder-generated code read-only and foldable in the ABL Editor. This ensures that users do not modify the AppBuilder-generated code while editing the ABL procedure (.w) file in the ABL Editor. Editing the AppBuilder-generated code might make the AppBuilder procedure (.w) file corrupt, and display errors when trying to open in the ABL GUI Designer.
The default display color for the read-only code is gray. You can set the display options of AppBuilder-generated code in the ABL Editor using the Editor preferences page. See Editor preferences.
Note: The Find/Replace option will not work with the read-only or auto-generated code of an AppBuilder procedure file. You cannot rename an internal procedure or function name which is part of the auto-generated or read-only code section.
There are two main &ANALYZE directives in an AppBuilder (.w) file: &ANALYZE-SUSPEND and &ANALYZE-RESUME. The &ANALYZE-SUSPEND directive causes the Analyzer to suspend analysis of ABL code. The &ANALYZER-RESUME directive causes the Analyzer to resume analysis. See Code analysis in GUI Designer.
The identifiers that define the read-only rules are the &ANALYZE-SUSPEND and &ANALYZE-RESUME statement directives. When an ABL procedure (.w) file is opened in the GUI Designer, the &ANALYZE-SUSPEND and &ANALYZE-RESUME directives code are parsed to mark the code sections within these directives as read-only and foldable in the ABL Editor.
Here is a list of sample illustrations with the code snippets marking the code section or block within the &ANALYZE directives as read-only or editable:
The following code snippet specifies that the code generated inside the &ANALYZE block is read-only except the definition section which is editable:
Any code which is not surrounded by &ANALYZE-SUSPEND and &ANALYZE-RESUME is read-only.
An &ANALYZE-SUSPEND statement which does not have _UIB-CODE-BLOCK or _QUERY-BLOCK as the second token is read-only.
An &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS block is editable.
The following code snippet specifies how triggers and the main block are editable:
An &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS block is not read-only.
An &ANALYZE-SUSPEND _UIB-CODE-BLOCK with _CONTROL as the third token is not read-only, but the first line inside the block is read-only.
The following code snippet specifies how procedures can be both read-only and editable, and the functions as editable. Note that the END PROCEDURE and END FUNCTION are editable:
An &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE with five tokens is not read-only.
An &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE with six tokens is read-only , unless the sixth token is _FREEFORM.
An &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION is editable. The data-type of the function must be editable.
When you add Extended Features (XFTR) block to a procedure or template, then the code becomes editable.
The following code snippet specifies how free form query elements inside a &ANALYZE-SUSPEND _QUERY-BLOCK section are editable:
An &ANALYZE-SUSPEND _UIB-CODE-BLOCK is editable between _START_FREEFORM and _END_FREEFORM or _START_FREEFORM_DEFINE and _END_FREEFORM_DEFINE tokens. These tokens are inside of comments.
The following code snippet specifies how a browser definition for a free form query is editable, allowing you to edit the field lists:
An &ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS section is editable when the sixth token is _FREEFORM.