Creating procedures as flowcharts
You can use the enhanced procedure editor to create linear or complex JavaScript procedures as flowcharts.
About this task
To add a command to a flowchart procedure:
Procedure
- Open the procedure editor and click the Design tab.
The Procedure Designer opens.
- To add a procedure command, double-click the block on the Design tab. You can also drag the command that you want to add from the Palette view to the block.
- In the Add Command wizard from the Command list, select a command, which you want to add to the procedure.
- For some commands select an object, to which you want to apply the command, from the Objects list.
- If the command with the specified object requires parameters,
click Next, and specify them on the second
page of the Add Command wizard:
- In the [command_name] Command area,
enter required values to corresponding fields. You can click Browse to
search for the object that you want to add or specify the directories
that you want to use in commands. Tip: Use the Browse button to add double quotation marks to the object name automatically. If you enter an object name manually, do not forget to add double quotation marks to it.
- For some commands, select one of the following options:
- Current object to use the object that is opened in the application.
- Object to use the object that is saved in the repository or QMF catalog.
- JavaScript variable to use a previously
created JavaScript variable. See an example of a JavaScript variable
and its use in a JavaScript procedure:
Example
JavaScript variable:var tableName = proc.prompt("Enter a table name", "");
JavaScript procedure:
/*JavaScript*/ var tableName = proc.prompt("Enter a table name", ""); proc.exec('DISPLAY TABLE ' + tableName);
- Specify the command parameters in the Parameters area. For more information about available procedures and their parameters, see the Procedure commands section.
- In the [command_name] Command area,
enter required values to corresponding fields. You can click Browse to
search for the object that you want to add or specify the directories
that you want to use in commands.
- Click Finish to close the wizard
and add the command to the procedure. Follow these steps to add each
command to the procedure. Tip: Use Comment option to add comments to the commands in the flowchart. They are visible only in the Procedure Designer.