Inside each of these routines is the identical subroutine:
Sigl: Return sigl
... this satisfies the need to know the current line number; the
sigl() function tells you.
Is there a way of doing this without having that "sigl()" function
defined in every ::Routine ?
I had a similar requirement, which was to get the name of the file
being executed. This one was much easier:
::Routine efn
Parse source . . efn
Return efn
--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Rick
>The .line environment variable contains the current line number.
Spectacular! I'll just have to wait until I'm sure that we won't be
going back to the system with IBM Object Rexx.
Thanks!
Well, one way (which may not exactly tell you what you wanted):
signal ....;....
and then SIGL will tell you the line that signal was on.
Of course, if this is done inside a DO loop, that destroys the
usefulness of it (those aren't elipses).
I use another version for the NOVALUE and SYNTAX labels:
novalue: xsigl=sigl; /*say something about novalue...*/
XSIGL now has the statement number that caused the NOVALUE
condition to be raised. I have to do this as my NOVALUE &
SYNTAX get triggered and call other subroutines to issue a
generic and informative message(s).
As for the PARSE SOURCE, it really doesn't give you the name of
the file being executed, but instead, gives you the command used to
invoke the REXX program. Some operating systems allow the use of
aliases, and VM/CMS in particular allows you to load any file and ya
can call it (some) a REXX program (with any name).
_____________________________________________ Gerard Schildberger
Windows gives the complete path of the running code.
--
Les (Change Arabic to Roman to email me)