Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU
Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!cit-hamlet.arpa!tjp%Phobos
From: tjp%Phobos@CIT-HAMLET.ARPA
Newsgroups: mod.computers.vax
Subject: Recursive DCL procedures
Message-ID: <8510312222.AA00768@ucb-vax.berkeley.edu>
Date: Thu, 31-Oct-85 16:15:53 EST
Article-I.D.: ucb-vax.8510312222.AA00768
Posted: Thu Oct 31 16:15:53 1985
Date-Received: Sat, 2-Nov-85 03:28:44 EST
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The ARPA Internet
Lines: 16
Approved: info-vax@ucbvax.berkeley.edu

Judging by the examples submitted to info-vax, not many people have 
noticed the facility provided in VMS V4 for creating recursive DCL
procedures:  F$ENVIRONMENT("PROCEDURE") returns the file name of the
command procedure being executed.  The following are two lines from
my own recursive procedure for deleting a directory tree (the rest is
left as an exercise for the reader):

$ DELDIR = "@" + F$ENVIRONMENT("PROCEDURE")
...
$ DELDIR [.'F$PARSE(FILESPEC,,,"NAME")']

Tim Pearson, Astronomy Dept, Caltech, Pasadena 91125, USA
ARPAnet:              tjp%phobos@cit-hamlet.arpa
BITNET:               tjp@caltech
NRAO Decnet:          Phobos::TJP
Telephone:            +1 818 356-4980