Make your own free website on
2.4.13 The OPTIONS Instruction
     OPTIONS expr ;

The OPTIONS instruction is used to set various interpreter-
specific options. Its typical uses are to select certain REXX
dialects, enable optimizations (e.g. time versus memory
considerations), etc. No standard dictates what may follow the
OPTIONS keyword, except that it should be a valid REXX expression,
which is evaluated. Currently, no specific options are required by
any standard.

The contents of expr is supposed to be word based, and it is the
intention that more than one option can be specified in one
OPTIONS instruction.  REXX interpreters are specifically
instructed to ignore OPTIONS words which they do not recognize.
That way, a program can use run-time options for one interpreter,
without making other interpreters trip when they see those
options. An example of OPTION may be:


The instruction might instruct the interpreter to start enforcing
language level 4.00, and to use native floating point numbers in
stead of the REXX arbitrary precision arithmetic.  On the other
hand, it might also be completely ignored by the interpreter.

It is uncertain whether modes selected by OPTIONS will be saved
across subroutine calls. Refer to implementation-specific
documentation for information about this.

Example: Drawback of OPTIONS

Unfortunately, the processing of the OPTIONS instruction has a
drawback. Since an interpreter is instructed to ignore option-
settings that it does not understand, it may ignore options which
are essential for further processing of the program. Continuing
might cause a fatal error later, although the behavior that would
most precisely point out the problem is a complaint about the non-
supported OPTION setting. Consider:

     options ‘cms_bifs’
     pos = find( haystack, needle )

If this code fragment is run on an interpreter that does not
support the cms_bifs option setting, then the OPTIONS instruction
may still seem to have been executed correctly.  However, the
second clause will generally crash, since the FIND() function is
still not available. Even though the real problem is in the first
line, the error message is reported for the second line.