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:
Patrick Santucci <[log in to unmask]>
Reply To:
Date:
Tue, 1 Aug 2000 15:56:16 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (56 lines)
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.

ATOM RSS1 RSS2