Professional Documents
Culture Documents
The range clause allows you to use a program to define range values. This allows the
flexibility to change range values depending on conditions. Use the range program
clause to specify the name of the program to execute.
Note: Dimensions are not supported with attributes that have range values.
For example:
range program
SetRanges;
You can define arguments to be passed into the program. Your program could change the
attribute range depending on the argument passed. For example:
When you pass arguments into the program they are referenced by variables within the program.
Variables 0, 1, 2. . . and so on are reserved by the system for passing in arguments.
Environment variable “0” always holds the program name and is set automatically by the system.
Arguments following the program name are set in environment variables “1”, “2”, . . . and so on.
Programs should return the list of choices in the variable that has the same name as the program
name, which can be obtained through argument “0.” Be sure to use the global keyword on your
set env command when passing the list back.
The following is output from a MQL session. The attribute type ‘designerName’ produces the
choices ‘Tom,’ ‘Dick,’ ‘Harry,’ ‘Larry,’ ‘Curly,’ and ‘Moe.’ An attribute type can have any number of
ranges, but only one range can be of type program.
ATTRNAME=designerName
ATTRTYPE=String
For more information, see Trigger Event Macros. The syntax for the trigger clause is:
For example, to assign a check trigger called OnApprove, you would use:
You can define arguments to be passed into the program. For example:
In this example, the argument passed into the OnApprove program is ChngChk.
When you pass arguments into the program they are referenced by variables within the program.
Variables 0, 1, 2… and so on. are reserved by the system for passing in arguments.
Environment variable “0” always holds the program name and is set automatically by the system.
Arguments following the program name are set in environment variables “1”, “2”,… and so on.