HP3000-L Archives

April 1997, 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:
Mark Bixby <[log in to unmask]>
Reply To:
Date:
Fri, 4 Apr 1997 20:33:52 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (35 lines)
Steve BARRETT writes:
>
> Can anyone explain the use of "brackets" ([]) related to
> dereferencing variables in CI programs?  They solve some problems
> when used to echo variables to the display.  But, I can't seem to
> find any documentation explaining their use in the CI command
> manuals.

More generally, you put brackets around CI expressions, not just variables.

For example, you could say:

:SETVAR A B+C
:ECHO The answer is !A

Or you could just directly say:

:ECHO The answer is ![B+C]

> Case in point - I defined a variable with a terminal control escape
> sequence to set "return = enter".  When echoed to the terminal using
> explicit dereferencing (echo !varname), the variable was evaluated as
> if it were a numeric expression and gave a division by zero error.
> Placing the variable name in "brackets" (echo ![varname]) solves the
> dereferencing problem.

I'm having trouble imagining the difference here.  What is the exact escape
sequence within !varname?
--
Mark Bixby                      E-mail: [log in to unmask]
Coast Community College Dist.   Web: http://www.cccd.edu/~markb/
District Information Services   1370 Adams Ave, Costa Mesa, CA, USA 92626-5429
Technical Support               +1 714 438-4647
"You can tune a file system, but you can't tune a fish." - tunefs(1M)

ATOM RSS1 RSS2