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:
Steve BARRETT <[log in to unmask]>
Reply To:
Steve BARRETT <[log in to unmask]>
Date:
Sat, 5 Apr 1997 09:39:00 +0000
Content-Type:
Text/Plain
Parts/Attachments:
Text/Plain (55 lines)
Mark Bixby Replied:

> Can anyone explain the use of "brackets" ([]) related to
> dereferencing variables in CI programs?  They solve some problems

<<snip>>

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

<<snip>>

> 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?

----------------------------Reply Separator--------------------------------

Mark,

The variable was originally defined as:

    setvar esc, chr(27)
    setvar nter, "!esc"+"&f1m149P<!154>"

However, the setvar statement was also returning a divide by zero
error.  I suspect the "!" causes the evaluation problem.

I then changed the setvar to:

    setvar nter, "!esc"+"&f1m149P<"+"!"+"154>"

This solved the setvar problem and the "brackets" solved the echo
problem.

Thanks for your clarification on the usage.

Steve Barrett

   ============================================================
   = Steven P. Barrett    [log in to unmask] =
   = Systems Analyst                                          =
   = Fairfax County Public Library     (703) 222-3132 - Voice =
   = Technical Operations Center       (703) 222-3135 - FAX   =
   = 4000 Stringfellow Rd.                                    =
   = Chantilly, VA  20151                                     =
   =                                                          =
   = --- The opinions expressed here are mine alone . ---     =
   ============================================================

ATOM RSS1 RSS2