Program Editor

Code Completion

Last Revised: 04/29/09

One of the benefits of using the Dynamo Program Editor is the ability to paste content sensitive code to the program being edited.  The code completion capabilities include:

Code completion is always initiated using the F2 function key.  The particular type of Code Completion generated is dependent on the cursor position within the program statement being edited.

Template Field Names - Enter a templated field name such as AP12 followed by a period, then touch F2.  You will be presented with a list of all the field names, array dimensions, and template field characteristics of each field in the template.  Note that the fields presented will be those defined in the data dictionary, even if the data file does not yet contain these fields.  This allows you to paste field names that are being added to a data file, during the development phase prior to actual file conversion.  Note also that this capability exists for all template based data structures, not just those associated with a data file.

Use the cursor movement keys to select the field desired, then touch Enter to paste the field name, including $ for string fields into the program statement being edited.  When a repeating field is pasted, the maximum repeat is pasted within square brackets, i.e., SALES[12].  Note the F5 option can be used to sort the fields alphabetically by name or by position within the record.

For any statement that requires a line label argument, such as END=, DOM=, GOTO, GOSUB, ON GOSUB, etc. touching the F2 key presents a list of all line labels present within the  program.  Line labels can also be selected for each branch of an ON XXX GOTO, or an ON XXX GOSUB routine.  Touch F2 after the comma to select a line label within an ON GOSUB or GOTO statement.

You can also list code starting at a line label.  Type S or L followed by a blank, then F2.

You can also search for all places a line label is used.  Type T\ followed by a blank, then F2.

The program editor also has access to libraries of all callable routines.  For example, if you would like to call the routine that counts the number of records in a data file that have a particular key prefix, you would enter CALL "CD where CD is the company code for the particular library to be accessed, then touch F2.  Next, you would enter some search phrase, or just touch enter to display the descriptions of all called routines in the library.  In this example, I entered the word "records". 

Highlight the desired called routine, and touch Enter, to paste the arguments used to call the selected program:

Now you can edit the pasted text to use the appropriate variables or constants to pass as arguments to the called routine.

Full documentation on each called routine can also be displayed.  If using a PC running the Facetwin terminal emulator, then the complete documentation for the called routine will be displayed in the web browser.  Other devices will display a text-only version of the documentation.  Note that the text-only version is somewhat older and less up-to-date than the html version.  Although not specifically part of code completion, the ability to display the documentation for a called routine is repeated here for your convenience.  While editing the statement with one or more CALL's, touch the F3 help key to display the list of help topics.

Highlight and select the help topic desired, and the appropriate help text document, or complete documentation for the called routine will be displayed in a web browser window.

The next code completion capability is for defined functions.  After entering FN touch F2 to display all local user defined functions.

Then select the desired function and touch Enter to past the function and its arguments into your code.

Dynamo Tools supports several different standard callable routines.  If you are writing a new callable routine, the program editor can paste a sample ENTER list into your program.  Touch F2 after the ENTER statement to obtain the list of options.

Highlight and Enter to select.

When merging code from another program, the F2 key can also be used to present a list of all eligible programs in a directory.  After a merge command has been partially entered, touch the F2 key to display the programs in the directory specified.


Then highlight the desired program and touch enter.

Line drawing characters can also be pasted.  This saves time over using the hexadecimal equivalent.  If none of the other content specific code completion options apply, then you will be presented with a list of the single and double line graphics characters for pasting.

Highlight the character desired, and press Enter to Paste.  Note that the particular character displayed is dependent on the code-page used by the terminal, terminal emulator, or thin client being used.