Calling Macro in a batch or online program enables you to insert
the lines of a Macro and to specify values to use for resolving its parameters
(if any). A Macro enables you to use standardized sequences of specific
code several times in the same program or in different programs. To call a
Macro, you must select it in the -CP Lines tab and assign
values to its parameters, if this Macro is parameterized.
About this task
To add a Macro call, you must:
- Open the-CP Lines tab of a Program or a Screen.
To do so, select a Program or Screen in the Design explorer view
of the Design perspective and double-click on it or select Open in
the popup menu. Then access its -CP Lines tab from the Overview tab
or directly by clicking the -CP Lines tab.
- Click the Add Macro... button. A selection
box opens up with the list of the Macros already present in the location.
If the Macro you want to call:
- Is displayed in this selection box, just click on its corresponding
checkbox and click OK.
- Is not displayed, just click on the New Macro button
in the selection box. In the creation wizard which opens up, enter the name and label of
a new Macro and click OK. The new Macro is then displayed
in the selection box. If you select it and click OK,
it will be called in the -CP Lines.
- If the Macro is parameterized, you must assign values to its parameters.
To assign a value:
- Select a Macro call in the left area of the tab.
- In the Parameters table of the Macro
call section, select the line of the appropriate parameter. Double-click
in the Value column and enter the parameter's value.
- Select another line in the table to display the new parameter's
value on the Macro call line.
- Repeat the operation for all the parameters used in the Macro.