Copyright (c) 2012-2016 Hyperion Entertainment and contributors.

AmigaOS Manual: ARexx Special Variables

From AmigaOS Documentation Wiki
Jump to: navigation, search

There are four special variables that ARexx sets automatically during execution of a script:

RC RC is set to return code from any executed host command. If an ERROR or SYNTAX interrupt occures, RC is set to the error code that triggered the interrupt. The NOVALUE and HALT interrupts have no effect on RC.
RC2 RC2 is a secondary return code set by a host command in case of an ERROR. It tells why the command execution failed. RC2 is set only when RC is greater than zero.
RESULT RESULT is set by a RETURN instruction in a subroutine that has been called. If the RETURN instruction has no expression on it, then RESULT becomes uninitialized. After a host command has been executed successfully, RESULT contains the command's result string. In case of an ERROR, RESULT is uninitialized.
SIGL SIGL contains the line number of the last instruction that caused a jump to a label.

None of these variables have an initial value. They may be altered by the user, but ARexx will continue to set them automatically when appropriate. The PROCEDURE and DROP instructions also affect these variables.