In <[EMAIL PROTECTED]>, on
11/04/2008
   at 11:40 AM, Itschak Mugzach <[EMAIL PROTECTED]> said:

>Look at this:

>A='**'
>Say Value(A)

REXX is not CLIST. An unquoted token that is not a keyword or lite4ral is
treated as a variable name. If you want to look up the value of A, use
value('A'); the code you give is asking for the value of **.

How can I stop REXX from interprate variable A?

Wrong question; you need to prevent REXX from treating the string A as a
variable. You do the by quoting it: 'A' or "A".

>CLIST has this function, BTW.

CLIST has the opposite problem; it swallows ampersands and apostrophes,
and you have to go through contortions to tell it that ' means ' and &
means &. With REXX there's no need for, e.g., STR().


In <[EMAIL PROTECTED]>, on
11/04/2008
   at 12:29 PM, Itschak Mugzach <[EMAIL PROTECTED]> said:

>I read a record from a dataset. A field named A holds the string value of
>'ABCD**'. I then pass the name of the variable to a routine.

REXX doesn't have call by name; you need to pass an expression whose value
is the variable name, e.g. 'A'.

>The routine resolved the value by name using VALUE(A).

That asks REXX to return the variable whose name is the value of A; if you
want the value of A, then you must pass the name of A, e.g., VALUE('A').

>In Clist, you can limit the number of
>levels it will interprate the variable. 

In REXX it is automatically limited to one level. You use value() when one
level isn't enough.

>I want REXX to return value by name

In REXX everything is a string. If you want to pass the name of A, use 'A'
or "A".

>without trying to resolve it and reference it like a string variable.

Then pass a literal and REXX will treat it as a literal.

See my Safe REXX article at REXLA.


-- 
     Shmuel (Seymour J.) Metz, SysProg and JOAT
     ISO position; see <http://patriot.net/~shmuel/resume/brief.html> 
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to