[Info-vax] puzzled by DCL symbol substitution

AEF spamsink2001 at yahoo.com
Tue Jan 10 19:17:51 EST 2012


On Jan 9, 10:19 pm, Lester Dreckow <lester.drec... at gmail.com> wrote:
> On Jan 7, 9:49 pm, AEF <spamsink2... at yahoo.com> wrote:
>
> > Here's another fun one:
>
> > $ SET VERIFY
> > $ TYPE COMMENT.COM
> > $ ! DIR = '&DIR'
> > $ @COMMENT
> > $ ! DIR = 'DIRECTORY/SIZE=ALL/DATE /WIDTH=(FILE=29,SIZE=7)'
> > $
>
> Good one!  I did know about $!'f$verify(0), but not this one.
>
> For years I have been wanting to slim down DCL procedure entry and
> exit comments.  Now I can do ...
>
> $ type comment.com
> $ self = f$environment("procedure")
> $!'&self'
> $
> $
> $ exit          !'&self'
>
> $ set verify
> $ @comment
> $ self = f$environment("procedure")
> $!'DISK1:[TEST]COMMENT.COM;1'
> $
> $
> $ exit          !'DISK1:[TEST]COMMENT.COM;1'
>
> Thanks.

Never though of that!

I used it for variable evaluation during a run with SET VERIFY in
effect:

$ TYPE BOO.COM
$    SPOOK = "ONE"
$    SPOOK = "BOO"    !  'SPOOK' = '&SPOOK'
$!  'SPOOK' = '&SPOOK'
$!  'SPOOK' = '&spook'

$ @BOO
$    SPOOK = "ONE"
$    SPOOK = "BOO"    !  'SPOOK'= 'ONE'
$!  'SPOOK'= 'BOO'
$!  'SPOOK'= ''

Notice that the trailing comment is evaluated before the command. Also
note that the symbol being evaluated in the comment must be spelled in
uppercase.

Note that the letters on the right-hand side *must* be uppercase!

AEF



More information about the Info-vax mailing list