[Info-vax] DCL puzzle/question
Peter Weaver
info-vax at weaverconsulting.ca
Wed May 2 20:02:31 EDT 2012
This does it in one line, but if I was writing the .COM I would go with the
two line version because I think it looks more readable.
$ if "''p2'" .eqs. ""
$ then
$ write sys$output "called with ''p1'"
$ exit
$ else
$ cd:=@'f$environment("procedure")
$ endif
$!
$ I = 0
$LOOP:
$ I = I + 1
$ if i .gt. 8 then goto done ! have to add this, otherwise the next line
breaks with exactly 8 arguments
$ IF P'I' .EQS. "" THEN GOTO DONE
$ cd 'f$fao("'P!SL",i)
$ GOTO LOOP
$DONE:
$!
$ @x one two three four
called with ONE
called with TWO
called with THREE
called with FOUR
Peter Weaver
Certified OpenVMS System Administrator
Certified OpenVMS System Engineer
Winner of the OpenVMS.org Readers' Choice Award for System
Management/Performance
http://www.weaverconsulting.ca
http://www.linkedin.com/in/peterweaver
More information about the Info-vax
mailing list