Statement Mode

When you run an IMLPlus program, IML Studio examines the Program window to see if any text is selected. If text is selected, IML Studio executes only the selected text, which must consist of one or more complete program statements. IML Studio does not clear the program's symbol table before executing the selected statements.

If there is no selection in the Program window, IML Studio's default behavior is to clear the program's symbol table and then execute all the program's statements. Each time you run the program, the program begins execution in a clean state with no variables defined.

IML Studio provides an alternative method of executing program statements called Statement Mode. When you run an IMLPlus program in Statement Mode, IML Studio executes only the statements in the same statement block as the cursor. In Statement Mode, IML Studio never clears the symbol table. This means that any variables that were assigned values in previously executed statement blocks will retain their values.

To toggle Statement Mode on and off

On the Program menu, click Statement Mode.

–or–

Press F4.

–or–

Click the Statement Mode button () on the toolbar.

The term statement block refers to statements that appear between Statement Block Separators. A Statement Block Separator is the following special comment line:

/*** statement block separator ***/

IML Studio also treats the beginning of the program window as the beginning of a statement block and the end of the program window as the end of a statement block.

If you execute a statement block that implicitly ends at the end of the program window, IML Studio automatically inserts a Statement Block Separator below the statement block and then moves the cursor to the end of the program window. This behavior enables you to type and execute a series of statements without having to insert any Statement Block Separators.

To insert a Statement Block Separator

On the Edit menu, click Insert Statement Block Separator.

–or–

Press SHIFT+F4.

To delete a Statement Block Separator

Delete the line containing the Statement Block Separator.

You can control whether or not IML Studio begins new workspaces in Statement Mode.

To configure the default Statement Mode setting

  1. On the Tools menu, click Options.

    IML Studio will display the Options dialog box.

  2. Click the Runtime tab.
  3. Select or clear the Statement Mode option per your requirements.
  4. Click OK.
Notes