Code Assist
To use code assist:
- Press
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 thewhile
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 after the comma behind the first argument of the dal.start.business.method function.
directly
after the last character of the string you want to complete.
- 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:
Icons
Code Assist can display suggestions for various types of 4GL elements. The following icons are used to distinguish the different element types:
- 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:
- Select Preferences dialog box is displayed. . The
- In the tree structure in the left pane of the dialog box, select Preferences - Code Assist dialog box is displayed. See the dialog box's online help for details. . The
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:
- Select Preferences dialog box is displayed. . The
- In the tree structure in the left pane of the dialog box, select Preferences - Templates dialog box is displayed. . The
- Click to add a template. A details dialog box is displayed.
- 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.
- In the Description field, enter a brief description of the template.
- Specify the template pattern in the Pattern field. The pattern may contain pre-defined variables.
- Click Preferences - Templates dialog. to return to the
- Click to save the new template.
- Click Preferences dialog. to close the
You can now use Code Assist to insert the template in your scripts and libraries.