HP3000-L Archives

August 2000, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Stigers, Greg [And]" <[log in to unmask]>
Reply To:
Stigers, Greg [And]
Date:
Tue, 1 Aug 2000 17:25:01 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (39 lines)
X-no-Archive:yes
Interesting problem. Try SETVAR HPCMDTRACE TRUE, and watch how your command
file behaves. I also tried adding showvars with the echoes while looking at
this. Where you have !x, it is replaced with the parm value, 2.
:setvar hpcmdtrace true
:test 2
 setvar x 2+1
 echo 2
2
 setvar x 2+1
 echo 2
2
:showvar x
X = 3

You don't need to explicitly dereference the variable in the setvar
statement. It isn't necessary in this context. And if I understand
correctly, command file parms don't entirely behave like variables. Try
this:
parm parm
setvar x !parm
setvar x x+1
echo !x
setvar x x+1
echo !x
deletevar x

I'm guessing that the parm gets entirely dereferenced before the command
file runs, so x is interpreted as already being 2. But when you setvar x to
increment parm x, you create a variable x, which is repeatedly set to 2+1.
So immediately after setvar x 2+1, echo !x has already been interpreted as
echo 2, and that's what you get. Yet after running the command file, showvar
x correctly shows the results of 2+1 as 3. That may be about as clear as
mud. Hopefully, Jeff Vance will see this sometime soon and state things with
better depth and clarity.

Greg Stigers
http://www.cgiusa.com

ATOM RSS1 RSS2