3.2.47. SOURCELINE([lineno])

If lineno (which must be a positive whole number) is specified,
this function will return a string containing a copy of the REXX
script source code on that line. If lineno is greater than the
number of lines in the REXX script source code, an error is
reported.

If lineno is unspecified, the number of lines in the REXX script
source code is returned.

Note that from REXX language level 3.50 to 4.00, the requirements
of this function were relaxed to simplify execution when the
source code is not available (compiled or pre-parsed REXX). An
implementation might make two simplifications: to return 0 if
called without parameter. If so, any call to SOURCELINE() with a
parameter will generate an error. The other simplification is to
return a nullstring for any call to SOURCELINE() with a legal
parameter.

Note that the code executed by the INTERPRET clause can not be
retrieved by SOURCELINE().

     SOURCELINE()   –>   ‘42’  /*Maybe */
     SOURCELINE(1)  –>   ‘/*This Rexx script will ... */’
     SOURCELINE(23) –>   ‘var = 12’     /*Maybe */’



PREV NEXT