Code Assist

When you specify text in the editor, Code Assist can provide you with a list of suggested completions for partially specified strings.

To use code assist:

  1. Press Ctrl+Spacebar directly after the last character of the string you want to complete.

    A list of completion proposals is displayed. This list can contain:

    • Various types of 4GL elements, such as functions, predefined variables, keywords, and program sections. These are read from the Infor ES Programmers Guide (Infor Customer Portal KB2924522).
    • Templates for programming statements, such as the on case statement and the while statement. These templates are defined in the Preferences - Templates dialog.
    • Functions that are declared in the source you are editing.
    • Functions declared in includes and libraries that are used in the source you are editing.
    • Domains.
    • Enumerated constants.
    • Tables.
    • Table fields.
    • Index fields in the where clause of a select statement.
    • External functions in the DAL that is selected in the dal.start.business.method function. You must press Ctrl+Spacebar after the comma behind the first argument of the dal.start.business.method function.
  2. Double-click the completion proposal you want to use. The completion proposal, for example a function name, or a template text, is added to your source code.

See the following figures for some examples.

The following is displayed when you start Code Assist after typing "crea" (functions from Infor ES Programmers Guide (Infor Customer Portal KB2924522)):

The following is displayed when you start Code Assist after typing "on":

When you double-click the on case statement in the previous figure, the template is inserted in the editor:

Note: After inserting a template in the editor, press Tab to navigate through the template's variables.

Icons

Code Assist can display suggestions for various types of 4GL elements. The following icons are used to distinguish the different element types:

Note: 
  • Code Assist can also display suggestions for keywords, SQL statements, some standard macro definitions, and various sub sections. However, these types are displayed without icons.
  • Code Assist does not display report main sections and form.<form number> sections.

Preferences

You can define various preferences for Code Assist, such as the following:

  • Automatic insert of completion proposals
  • Background color for the completion proposal
  • Foreground color for the completion proposal
  • Auto activation trigger character (default is the dot (.) sign). Code Assist is started automatically when you type this character.
    • Important: the auto activation trigger character is used as part of the search string. For example, when you type "aud.", Code Assist shows a list of functions whose names start with "aud." (including the dot sign!); for example "aud.audit.is.on.for.table" and "aud.close.selection". Function names starting with "aud" (without the dot sign), such as "aud_close_audit" and "aud_get_audit_dd", are not displayed.

To define preferences for Code Assist:

  1. Select Window > Preferences. The Preferences dialog box is displayed.
  2. In the tree structure in the left pane of the dialog box, select Infor LN Studio Application > Editor > Code Assist. The Preferences - Code Assist dialog box is displayed. See the dialog box's online help for details.

Code Assist Templates

LN Studio contains predefined templates for various programming statements, such as on case, for, repeat and while. You can use Code Assist to include these templates in your scripts or libraries. See the previous figures for an example on the on case statement.

You can also add you own templates and use them in the same way as the predefined templates.

To add your own templates:

  1. Select Window > Preferences. The Preferences dialog box is displayed.
  2. In the tree structure in the left pane of the dialog box, select Infor LN Studio Application > Editor > Templates. The Preferences - Templates dialog box is displayed.
  3. Click New to add a template. A details dialog box is displayed.
  4. In the Name field, enter the name for the template. This name does not have to be unique. It is used as a display name only.
  5. In the Description field, enter a brief description of the template.
  6. Specify the template pattern in the Pattern field. The pattern may contain pre-defined variables.

    See Preferences - Templates.

  7. Click OK to return to the Preferences - Templates dialog.
  8. Click Apply to save the new template.
  9. Click OK to close the Preferences dialog.

You can now use Code Assist to insert the template in your scripts and libraries.