Copyright (c) Hyperion Entertainment and contributors.

Difference between revisions of "AmigaOS Manual: ARexx Special Variables"

From AmigaOS Documentation Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
There are three special variables that ARexx sets automatically during execution of a script:
 
There are three special variables that ARexx sets automatically during execution of a script:
  +
{| class="wikitable"
 
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.
+
| 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.
  +
|-
 
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.
+
| 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.
  +
|-
 
SIGL contains the line number of the last instruction that caused a jump to a label.
+
| 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.
 
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.

Revision as of 07:38, 19 November 2014

There are three 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.
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.
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.