This page contains parameters defining the Method editor interface and it default display as well as options concerning its operation. It is divided into three sections accessed using the Styles, Options, and Colors tabs.
The options in this area can attribute specific styles and colors to each 4D language item (fields, tables, variables, parameters, SQL, etc.) and also to each SQL language item (keywords, functions, etc.). Combining different colors and styles is particularly useful for code maintenance purposes.
Language: Use this menu to choose either the 4D or SQL language. You can then specify the styles to be applied in the Method editor for each item listed. This list of items changes according to the language chosen in the menu.
List of item types: Check the style options in the table to set the corresponding graphic attributes for syntax items. You can combine several options for each item. The item label reflects any changes made. To change colors, click on the color icon for an item and a palette appears where you can choose a new color. Notes:
In the 4D language, the "Plain text" item designates all text that does not belong to any other specified type (i.e. symbols, punctuation, literal constants, etc.).
In the 4D language, the "Keywords" item designates programming structures (If/End if, Case of/End case, etc.) that are accessed using Macros. In the SQL language, it designates all the commands and their associated keywords.
Use regional system settings: allows you to disable/enable the "international" code settings for the local 4D application:
When this option is unchecked (default value in 4D v15 and higher), English-US settings and the English programming language are used in 4D methods.
If this option is checked, regional settings are used in 4D methods, as in previous 4D versions.
If you modify this option, you need to restart the 4D application so that the change is taken into account. For a detailed description of this option's effects, refer to the OLD RELATED MANY section.
This area configures Method editor display options:
Indentation: Changes the indentation value for the 4D code in the Method editor. The width must be specified in points (10 by default). 4D code is automatically indented in order to reveal its structure: Modifying this default value can be useful if your methods contain complex algorithms with many levels of embedding. Narrower indentation can be used in order to limit horizontal scrolling.
Show Line Numbers: Lets you display the line numbers by default in each window of the Method editor. You can also show/hide line numbers for the current window directly from the Method editor.
Show Lists: lets you choose whether or not to show the lists of objects (Commands, Tables and fields, etc.) by default when the Method editor window is opened. You can also show or hide each list directly from the Method editor.
Highlight the logical blocks: When checked, the whole code belonging to a logical block (If/End if for example) is highlighted when the mouse is placed over the expanded node: Note: The highlight color can be set in the "Colors" page.
Always show block lines: Allows to hide vertical block lines permanently. The block lines are designed to visually connect nodes. By default, they are always displayed (except when collapse/expand icons are hidden, see below).
Hide collapse/expand icons: Allows to hide all expand/collapse icons by default when displaying code. When the option is checked, node icons (as well as local block lines, see above), are displayed temporarily when the mouse is placed over a node:
Insert () and closing } ) ] ": Enables automatic insertion of () and closing braces while typing code. This option controls two automatic features:
parentheses pair () added after a 4D command, keyword or project method inserted from a suggestion or completion list, if the inserted element requires one or more mandatory arguments. For example, if you type "C_OB" and press Tab, 4D writes "C_OBJECT()" and sets the insertion point inside the ().
closing }, ), ], or " character added when you type respectively an opening {, (, ], or ". This feature allows inserting matching pairs of symbols at the insertion point or surrounding a selected text. For example, if you highlight a string and type a single ", the whole selected string will be enclosed in "": -> " ->
Matching [](){}: sets the graphic signaling of matching braces in the code. This signaling appears whenever a square bracket, parenthesis, or curly bracket is selected. The following options are available:
None: No signaling
Rectangle: Braces surrounded by a black line
Background Color: Braces highlighted (the color is set in the "Colors" area, see the “Colors” paragraph below)
Bold: Braces displayed in bold.
By default, the Rectangle option is selected:
Highlighted variables and fields: Allows to highlight all occurrences of the same variable or field in an open method window. The following options are available:
No (default): No highlight
On cursor: all occurrences are highlighted when the text is clicked
On selection: all occurrences are highlighted when the text is selected
Note: The highlight color can be set in the "Colors" page.
Highlight the line running: Highlights the line that is currently running in the debugger (see Debugging), in addition to the regular yellow arrow indicator. If you deselect this option, only the yellow arrow is shown.
This area lets you configure autocomplete mechanisms in the Method editor to adapt it to your own work habits.
Automatic opening of window for: triggers the automatic display of the suggestion window for constants, local and interprocess variables, object attributes, tables, and prototypes (i.e. class functions). For example, when the "Variables (local or interprocess) and object attributes" option is checked, a list of suggestions appears when you type the $ character: You can disable this functioning for certain elements of the language by deselecting their corresponding option.
Validation of a suggestion for: sets the entry context that allows the Method editor to validate automatically the current suggestion displayed in the autocomplete window.
Tab and delimiters: When this option is selected, you can validate the current selection with the Tab key or any delimiter that is relevant to the context. For example, if you enter "ALE" and then "(", 4D automatically writes "ALERT(" in the editor. Here is the list of delimiters that are taken into account: ( ; : = < [ {
Tab only: When this option is selected, you can only use the Tab key to insert the current suggestion. This can be used more particularly to facilitate the entry of delimiter characters in element names, such as ${1}. Note: You can also double-click in the window or press the Carriage return key to validate a suggestion.
These options configure the various colors used in the Method editor interface.
Line where the cursor is (active window) / Line where the cursor is (inactive window): Background color of line containing the cursor.
Highlight of the found words: Highlight color of words found in a search.
Highlight of the parentheses: Highlight color of corresponding parentheses (used when pairs of parentheses are signaled by highlighting, see the “Options” paragraph above).
Editing area background: Background color of Method editor window.
Suggested text: Color of autocomplete text suggested by the Method editor.
Highlight of the blocks: Highlight color for selected logical blocks when the "Highlight logical blocks" option is enabled in the Options page
Highlight of the same variable or field: Highlight color for other occurrences of the same variable or field text when one of the "Highlighting variables and text" option is enabled in the Options page.
Highlight of the running line in the debugger: Highlight color of the line currently running in the debugger when the "Highlight line running" option is enabled in the Options page.
Border of the running line in the debugger: Color of the border surrounding the line currently running in the debugger when the "Highlight line running" option is enabled in the Options page.