Genero Studio Overview: Code Editor

Genero Studio video scripts

Related video: Genero Studio Overview: Code Editor

The Code Editor is a programming-oriented editor for any kind of text or language (BDL, plain text, per, HTML, XML, C++, and so on.) Code Editor is launched when a file is opened or created. To speed development, create new documents from pre-populated template files. Select File>New to view template Categories and document Types.

Code Editor includes standard editor features, such as a code structure view with ‘go-to’ and bookmark capability, syntax highlighting, and code folding. In addition, it  has some unique features to make coding easier.

(1) Keywords, strings, variables and comments are each colored differently for easier viewing and navigation.

(2) Toggle between Document Editing mode and Full Screen editing mode using the Window menu option or shortcuts.  Alt-Shift-F11 toggles to Full Screen mode, and Alt-F11 switches back to Document Editing mode.

(3) Press the ALT key while selecting text with the mouse to select a rectangle of text, instead of entire lines.

(4) The Function Search feature displays the occurrences of a function in any of the files in the current workspace. Double-click a file listing in the Output panel to open a different file. The Search/Replace view allows search and/or replace of text in one or more documents.

(5) Code Editor supports VI emulation. Choose Edit>>VI Editing mode from the main menu to open a command line at the top of the window to enter Unix vi editing commands.

(6a)  Some Code Editor features offer coding assistance: The Code Completion feature provides suggestions for names and syntax on calls to built-in classes and methods as well as utility functions. It also displays a list of database columns when defining a program variable as ‘LIKE’ a database column.

(6b) Code templates are snippets of frequently used code elements that can be inserted into the code to speed up the coding process and avoid repetitive typing. Code Editor comes with a set of code templates, but additional, custom templates can be added. To use a code template, position the cursor where the code to should appear, and press Ctrl+T to display a list of code templates. Select from the list using the arrow keys, and press Enter. The selected template is inserted in the document using the exact layout.

(6c) The Code Editor automatically checks syntax, and errors are clearly indicated in the current file. An error displays a marker in the gutter and the full error text in the Document Errors panel. Double-click on an error in the Document Errors panel to jump to the error location in the file. Press ‘F1’ in Code Editor to get context sensitive help for any keyword. Fixing the error removes the marker and message.

(7) Most Code Editor features, such as Code Completion and auto-formatting apply to XML files as well. Code Editor recognizes XML documents, and provides XML editing support for Genero XML files. Syntax and schema validation for third party XML files is also supported when an .xsd – the schema definition file is provided.

Schema definition files (XSD or DTD) can be added to the Studio Catalog file to validate third party XML documents. The XML catalog files to be used by Genero Studio are specified through the Genero Studio Preferences where additional catalogs can be added or existing catalog entries edited.

(8) A Sequence Diagram is a powerful tool for code analysis. Right-click on a BDL function name and select “View Sequence Diagram” to view the sequence of interactions between the user and functions and how the functions interact with each other.

(9) Code Editor settings like line numbering, colors, and code completion templates can be customized in Preferences (Tools >> Preferences >> Code Editor)

Code Editor makes coding easier.