Getting cmd file name - OS/2 REXX 
Author Message
 Getting cmd file name - OS/2 REXX

Hi there,

Anyone know of a way of determining the filename of the REXX
script being executed. ie. have a script determine its _own_
filename?

In C or similar, the 'zero-th' command argument is the command
used to invoke the current process, but ARG(0) is not defined
in REXX, and ARG(1) is the first _parameter_.

Any suggestions?

Regards,
Paul Gallagher
--------------------------------------------------------------

 Desktop Computing Support - Computer Services Group
 BHP Research - Melbourne Laboratories
 245 Wellington Rd, Mulgrave, 3170, AUSTRALIA

      Standard disclaimer: these are personal opinions.
 "Watch the turtle. He only moves forward by sticking his
  neck out." - unknown, as quoted by Louis Vincent Gerstner
==============================================================



Sat, 09 Aug 1997 15:05:46 GMT  
 Getting cmd file name - OS/2 REXX

Quote:
>Anyone know of a way of determining the filename of the REXX
>script being executed. ie. have a script determine its _own_
>filename?

PARSE SOURCE . . programName

The two ignored values are the operating system, and call method (i.e. COMMAND,
SUBROUTINE, or FUNCTION).

------------------------------------------------------------------------------
-- Bill Schindler            Books: "Teach Yourself REXX in 21 Days" (SAMS)

------------------------------------------------------------------------------



Sun, 10 Aug 1997 01:08:46 GMT  
 Getting cmd file name - OS/2 REXX

Quote:

>Hi there,
>Anyone know of a way of determining the filename of the REXX
>script being executed. ie. have a script determine its _own_
>filename?
>In C or similar, the 'zero-th' command argument is the command
>used to invoke the current process, but ARG(0) is not defined
>in REXX, and ARG(1) is the first _parameter_.
>Any suggestions?

Look at PARSE SOURCE source
The third word should be the name of the REXX command file executing.

Cheers, Mark.
------------------------------------------------------------------------

DBA,ITS                               Phone: +617 875 7691
Griffith University                   Fax:   +617 875 5314
Nathan, Brisbane                      ***** PDCurses Maintainer *****
QLD 4111                              *** Author of THE and GUROO ***
Australia                             ======= Member of RexxLA ======
------------------------------------------------------------------------



Sun, 10 Aug 1997 06:10:50 GMT  
 Getting cmd file name - OS/2 REXX

Quote:

>Anyone know of a way of determining the filename of the REXX
>script being executed. ie. have a script determine its _own_
>filename?

Paul,
Try this:

/* */
Parse Source . . filename;
Say filename;
Exit;

********************************************************************
* Trey Bowman                                                      *

* Martin Marietta Information Systems                              *
* 12506 Lake Underhill Road  MP1269                                *
* Orlando, Florida  32825                                          *
*(407)356-4965                                                     *
********************************************************************



Sun, 10 Aug 1997 02:14:39 GMT  
 Getting cmd file name - OS/2 REXX
parse source foo.
Foo then contains half-dozen words the first of which ( seem to remember) is the
filename.  Check it out.
______________________________ Reply Separator _________________________________
Subject: Getting cmd file name - OS/2 REXX

Date:    2/21/95 9:18 AM

Hi there,

Anyone know of a way of determining the filename of the REXX
script being executed. ie. have a script determine its _own_
filename?

In C or similar, the 'zero-th' command argument is the command
used to invoke the current process, but ARG(0) is not defined
in REXX, and ARG(1) is the first _parameter_.

Any suggestions?

Regards,
Paul Gallagher
--------------------------------------------------------------

 Desktop Computing Support - Computer Services Group
 BHP Research - Melbourne Laboratories
 245 Wellington Rd, Mulgrave, 3170, AUSTRALIA

      Standard disclaimer: these are personal opinions.
 "Watch the turtle. He only moves forward by sticking his
  neck out." - unknown, as quoted by Louis Vincent Gerstner
==============================================================



Sat, 09 Aug 1997 18:29:26 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. OS/2 REXX .cmd file EAs

2. NULling OS/2 Commands in a REXX .CMD

3. OS/2 REXX CMD SCRIPT PROBLEM

4. OS/2 Rexx, CMD lines, and percent chars

5. Using Start cmd from Rexx in OS/2

6. File name of running .cmd?

7. Translating DOS .BAT file to OS/2 .CMD

8. passing arguments to external os/2 .CMD files

9. OS/2 .CMD files running on LINUX

10. Build .EXE for a rexx .cmd file

11. Change directory cmd file - DCD.CMD

12. Wanted: Sample REXX .cmd files!

 

 
Powered by phpBB® Forum Software