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:


  1. Open the procedure editor and click the Design tab.
    The Procedure Designer opens.
  2. 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.
  3. In the Add Command wizard from the Command list, select a command, which you want to add to the procedure.
  4. For some commands select an object, to which you want to apply the command, from the Objects list.
  5. If the command with the specified object requires parameters, click Next, and specify them on the second page of the Add Command wizard:
    1. 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.
    2. 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:


        JavaScript variable:
        var tableName = proc.prompt("Enter a table name", "");

        JavaScript procedure:

        var tableName = proc.prompt("Enter a table name", "");
        proc.exec('DISPLAY TABLE ' + tableName);
    3. Specify the command parameters in the Parameters area. For more information about available procedures and their parameters, see the Procedure commands section.
  6. 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.