EXTERNAL option is not specified, the ::ROUTINE directive starts a
routine, which is ended by another directive or the end of the program.
PUBLIC option, the routine is visible beyond its containing
Rexx program to any other program that references this program with a ::REQUIRES
directive. If you do not specify the PUBLIC option, or specify the PRIVATE option, the routine is visible
only within its containing Rexx program.::class c
::method a
call r "A" /* displays "In method A" */
::method b
call r "B" /* displays "In method B" */
::routine r
use arg name
say "In method" name
EXTERNAL option is specified, then spec
identifies a routine in an external native library that will be defined as the
named routine for this program. The spec is
a literal string containing a series of whitespace delimited tokens defining the
external function. The first token identifies the type of native routine to
locate:LIBRARYREGISTEREDREGISTERED is the
equivalent of loading an external function using the
RXFUNCADD built-in function.
-- load a function from rxmath library
::routine RxCalcPi external "LIBRARY rxmath"
-- same function, but a different internal name
::routine Pi external "LIBRARY rxmath RxCalcPi"
-- same as call rxfuncadd "SQLLoadFuncs", "rexxsql", "SQLLoadFuncs"
::routine SQLLoadFuncs EXTERNAL "REGISTERED rexxsql SQLLoadFuncs"