to watch out for these little quirks of
the language.
Jerry
-Original Message-
From: Bill Haskett [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 23, 2007 9:11 PM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] curious EQUATE issue - SOLVED Just want to know if
anyone understands WHY
We are running in Reality flavor on UniVerse 10.2.4 and Red Hat Linux AS3. Here
is a test of the code using the two forms of LOCATE:
EQU VALID.CC.TYPES TO 'A':@VM:'B':@VM:'D':@VM:'M':@VM:'S':@VM:'V'
EQU VALID.CC.NAMES TO 'American Express':@VM:'Carte Blanche':@VM:'Diners
Allen,
In your example, you use a variable in an EQUATE statement. This
references the variable's pointer, not its value. So the code:
TEMP = CHANGE('A.B.D.M.S.V','.',@VM)
EQU VALID.CC.TYPES TO TEMP
TEMP = SOMETHINGELSE ;* change TEMP's value
DISPLAY VALID.CC.TYPES
will display
Hi Rex,
Interesting, never tried it before. I've only used it when I've had stuff
that wouldn't go directly into EQU such as @(-1) in MvBASE. In that case I
did:
CCLR = @(-1)
EQU CLR TO CCLR
Wonder if
EQU VALID.CC.TYPES TO CHANGE('A.B.D.M.S.V','.',@VM)
Would work or error out.?
Allen,
EQU VALID.CC.TYPES TO CHANGE('A.B.D.M.S.V','.',@VM)
does compile and it will protect the value of VALID.CC.TYPES from being
unintentionally changed -- which is the reason for using EQU to declare
constants in the code.
I just wanted to remind people that equating to a variable does
regarding the example below:
EQU VALID.CC.TYPES TO CHANGE('A.B.D.M.S.V','.',@VM)
The problem with this is that the CHANGE within the EQU will get
evaluated at run time, so it will be done repeatedly if placed within
a LOOP or FOR structure.
You would be better off with the earlier
: Tuesday, October 23, 2007 7:06 AM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] curious EQUATE issue - SOLVED Just want to
know if anyone understands WHY?
We are running in Reality flavor on UniVerse 10.2.4 and Red
Hat Linux AS3. Here is a test of the code using the two forms
of LOCATE
When the new version of the equate was compiled under Information
flavor, the compiler warned that it was a Reality style LOCATE.
To its credit, the compiler defers the evaluation of the EQU until it
is used, at which point, it evaluates it in context, so the compiler
is evaluating
Very oddnot sure why, mass hysteria? ;-)
I'll tell you what, this is an easier construct, especially if you have two
dozen or so values to stick into an array.
TEMP = CHANGE('A.B.D.M.S.V','.',@VM)
EQU VALID.CC.TYPES TO TEMP
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL
Richard Nuckolls wrote:
the compiler is evaluating VALID.CC.TYPES1,1 as
A':@VM:'B':@VM:'D':@VM:'M':@VM:'S':@VM:'V'1,1
The precedence of concatenation is lower than dynamic array extraction. Try
placing parenthesis characters around the equate definition. E.g. EQU
VALID.CC.TYPES TO
10 matches
Mail list logo