Fundamentals: Feedback
Macros often need to present information to the user or prompt them for values. This is very true when debugging macros, but also true in just their regular use. For this purpose, SmartCAM's macro system provides two commands. One displays information to the user, the other prompts the user for information.
- The
PAUSE
command pauses the macro. A message box is displayed where the user is instructed to select a button (such as OK or Cancel) or press a key to continue. - The
PROMPT
command pauses the macro. A message box is displayed that requests input for a user variable.
To create a message box in a macro, add a PAUSE
or PROMPT
command to the
.mcl
file.
Using the PAUSE Command
Use the PAUSE
command to display a message box that:
- includes an Ok button that you select after reading the information.
- includes a Cancel button that enables you to exit the macro and an Ok button that continues the macro.
- displays a message for a specified period of time, then closes, with no user input.
The PAUSE
command uses the following syntax:
PAUSE[TX="body of text",LR=##,LC=##,SR=##,SC=##,PT=0]
Where:
- body of text is the information to display. It must be in quotation marks.
LR
andLC
specify the location of the upper left corner of the message box in the graphic view. The default is to open centered in the SmartCAM window.SR
andSC
specify the size of the message box in rows and columns. The default is 4 rows by 40 columns. A single character of text takes 1 row and 1 column.PT
identifies which display options to use.PT=0
displays a single Ok button.PT=1
selects the two button option; Ok and Cancel.PT=2
or larger specifies the display time in seconds.
Using the PROMPT Command
Use the PROMPT
command to create a message box that requests input for a user variable.
You can have SmartCAM display the name of the variable (the current value is always shown). This
enables you to provide a description of the user variable and how it relates to the model.
The PROMPT
command uses the following format:
PROMPT[TX="body of text",VN="varname",LR=##,LC=##, SR=##,SC=##,DV=#]
Where:
- body of text is the information to display. It must be inside quotation marks.
- varname is the name of the user variable. This is optional, but it must be inside
quotation marks when used. It relates to the
DV
setting. If the user variable is not defined, SmartCAM does not display a name, regardless of theDV
setting. LR
andLC
specify the location of the upper left corner of the message box in the graphic view. The default is centered in the window.SR
andSC
specify the size of the message box in rows and columns. The minimum size is 2 rows by 40 columns.DV
turns the display of the variable name on and off. Enter 1 to display the variable name and 0 to turn the display off.
Related Topics