The RETURN command exits a command file or UDC and returns to the calling process, whether it is the CI, an application, or another UDC or command file. This provides a mechanism for creating an error routine. The following routine tests that a parameter is a positive integer. If not, an error message is displayed, and control is returned to the calling environment.
PARM COUNT, P2=" ", P3=" "
IF TYPEOF(!COUNT) <> 1 OR !COUNT < 0 THEN
ECHO Expected a positive integer for COUNT
RETURN
ENDIF
|
The ESCAPE command can also be used to exit a command file or UDC. Unlike RETURN, ESCAPE causes control to leave all UDCs or command files, regardless of nesting levels, and returns to the CI prompt. If a jobstream invokes the command, the job is flushed from the system.