Code Editor basics

The active document is displayed in the Document workspace. If this document is a code document, such as a .4gl file, the Code Editor functions are active.

Multiple documents can be open, in tabbed windows, with the filename on the tab.

By default, line numbers are displayed at the left side of the window.

The status bar at the bottom of the window contains the selection range (line and column of the start and end position), the format (Windows®, UNIX™, Mac®), and the mode (insert, overstrike).

The Code Structure view displays information about the structure of the active file. Click on an element in the Structure view to display and highlight the corresponding lines in the Editing window.

vi Editor

You can change the editor to use vi commands. Select Edit > VI Editing Mode to switch the editor.

Syntax highlighting

The elements of the program are visually highlighted. Language key words, strings, variables and comments are each colored differently, making the program structure easier to understand. Select Tools > Preferences (or, if you are on a Mac, Genero Studio > Preferences), then Code Editor to customize the behavior and color.

Syntax errors

An error mark in the gutter flags syntax errors as they occur. Select the error mark to display a message concerning the error. The error message and line number also display in the Document Errors tab in the output.

Menu of options

Use the Edit menu or right-click in the document to display options for selecting, searching, and editing. The available accelerator keys are documented in the Keyboard Shortcuts page.

Document Format

You can change the document format (Windows, UNIX, MAC) by selecting Edit > Convert to.

Integrated diff

The Diff tool tool is integrated into Code Editor.

Folding text

Folding condenses portions of text based on the scope of statements.

Click the + or - symbols in the left gutter to fold or unfold all corresponding lines. Use the View menu or right-click context menu options to Fold, Fold all, or Unfold all.

Finding declarations

Press the CTRL key while clicking on a function or variable name to find the declaration of that function or variable.

Finding callers of a function

To find out where a function has been called, right-click on the function name and select Callers.

Square selection

Press the Alt-Shift keys while selecting text with the mouse to select a rectangle of text instead of entire lines. See Selection keymap.

If you enter text while a rectangle is selected, all the selected lines are edited. For example, in Figure 1, you used Alt-Shift and the arrow keys to select all the AND operators, and changed them simultaneously to OR.

Figure: Square selection editing

This figure illustrates multiple line editing in the Code Editor.