14.4.1 Function

The Rexx builtin function “value()” is used to retrieve the value of existing variables. On optional para-
meter can be used to searchwithin a specific variable pool. To retrieve the values of Hercules symbols the
“SYSTEM” pool must be specified, to retrieve the values of Hercules (and other) environment variables
the “ENVIRONMENT” pool must be specified. See the Regina Rexx documentation for more details on
“value()”.

14.4.2 Syntax

Descriptive

Diagram

Êʬ¬¬ ¬¬¬ (
¬¬¬ symbol ¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬Ê

ʬ¬¬§¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬§¬¬¬ )
¬¬¬¬¬¬¬¬¬¬¬¬¬¬ÊÍ


, ¬¬¬§¬¬¬¬¬¬¬¬¬¬¬¬¬§¬¬¬ ,
¬¬¬§¬¬¬¬¬¬¬¬¬¬¬¬§¬¬¬





pool

14.4.3 Parameter

symbol

This names an existing variable. If symbol does not name an existing variable, the
default value is returned, and the NOVALUE condition is not raised.

If symbol is not a valid symbol name and the function is used to access an normal
Rexx variable, an error occurs.

value

If the optional second parameter value is specified, the variable will be set to that
value, after the old value has been extracted.

pool

The optional parameter pool might be specified to select a particular variable pool
to search for symbol. The contents and format of pool is implementation depen-
dent.

The default is to search in the variables at the current procedural level in Rexx.
Which pools that are available is implementation dependent, but typically one can
set variables in application programs or in the operating system.

Specify “SYSTEM” to retrieve the value of a Hercules symbol or “ENVIRONMENT”
to retrieve the value of a Hercules (or another) environment variable.

14.4.4 Examples

Example 1:

Retrieve the value of the Hercules symbol “version”.

say 'Hercules version = ' VALUE('version',,'SYSTEM')

Example 2:

Retrieve the value of the Hercules environment variable “HERCULES_RC”.

say 'Hercules RC = ' value('HERCULES_RC',,'ENVIRONMENT')

14.5 Error Handling

The error handling differentiates between the following types of errors:

Command Errors Command Failures


An invalid command (‘command not found’) is treated as a ‘command error’. Command errors may be
handled with “SIGNAL ON ERROR”.

Failures in an otherwise valid command are treated as ‘command failures’. Command failures may be
handled with “SIGNAL ON FAILURE”.

Command return codes < 0 are interpreted as ERROR, return codes > 0 are interpreted as FAILURE.
Hercules will abort the startup process if the configuration file Rexx script returns with a non-zero return
code.

Previous Page Next Page