|command||One or more MultiValue commands, each command specified as a quoted string. A string can be quoted using single quotes ('cmd arg'), double quotes ("cmd arg"), or backslashes (\cmd arg\). To specify multiple commands, separate the commands with a Field Mark ("cmd1 arg":@FM:"cmd2 arg").|
The PERFORM command executes the specified Caché MultiValue command(s), then resumes execution of the MVBasic program. It initially searches the VOC for the command; if the command is not found in the VOC, it searches the global catalog. For lookup details, refer to CATALOG in the Caché MultiValue Commands Reference.
EXECUTE, PERFORM, and CHAIN
The EXECUTE command executes one or more MultiValue commands from within MVBasic, then returns execution to the next MVBasic statement in the invoking program. EXECUTE can pass values to the MultiValue command(s) and return values from the MultiValue command(s).
The PERFORM command executes one or more MultiValue commands from within MVBasic, then returns execution to the next MVBasic statement in the invoking program. PERFORM cannot pass or return values.
The CHAIN command executes a single MultiValue command from within MVBasic. It does not return execution to the invoking program. CHAIN cannot pass values.
In Reality and D3 emulations, the PERFORM command is functionally identical to the EXECUTE command.
In UniData and UDPICK emulations, a command name with an initial character of * is handled as a global name. PERFORM removes the leading * and then looks up the resulting command name in the global catalog in SYS.MV, rather than looking up in the VOC. If the runtime environment is not a UniData emulation, a normal VOC lookup is done on the *command name.
The following example shows how to use PERFORM to execute multiple MultiValue commands:
PRINT TIME() PERFORM "SLEEP 2":@FM:"SLEEP 3" PRINT TIME()