Larry Simonsen wrote:
> The problem stems from the fact that x is both a parm and a variable. I
> believe the parm overrides the system variable.
Yes, but you can "force" it to do what you want. Putting brackets "[]"
around a variable tells the CI to use the variable instead of the parm:
:print test
parm x
setvar x !x + 1 <-- Here you want the original parm value
echo ![x] <-- For the rest, you don't...
setvar x ![x] + 1
echo ![x]
:setvar hpcmdtrace true
:test 2
setvar x 2 + 1
echo 3
3
setvar x 3 + 1
echo 4
4
:showvar x
X = 4
:
Obviously you can do the same thing without brackets by substituting
another name for the variable 'x' so you can see easily see the difference
between the parm and the var:
:print testy
parm x
setvar y !x + 1
echo !y
setvar y !y + 1
echo !y
:testy 2
setvar y 2 + 1
echo 3
3
setvar y 3 + 1
echo 4
4
:showvar y
Y = 4
:
HTH,
Patrick
--
Patrick Santucci
Technical Services Analyst
Seabury & Smith, Inc.