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
Club':@VM:'Mastercard':@VM:'Discover':@VM:'Visa'
EQU VALID.CC.TYPES2 TO 'A]B]D]M]S]V'
EQU VALID.CC.NAMES2 TO 'American Express]Carte Blanche]Diners
Club]Mastercard]Discover]Visa'
CC.ACCT.TYPE = 'A'
CRT 'Equate with @VM: ':VALID.CC.TYPES
CRT 'Equate with @VM: ':VALID.CC.NAMES
CRT
CRT 'Equate with `253: ':VALID.CC.TYPES2
CRT 'Equate with `253: ':VALID.CC.NAMES2
CRT
CRT 'Account type: ':CC.ACCT.TYPE
CRT
CRT 'FIRST WAY'
LOCATE(CC.ACCT.TYPE, VALID.CC.TYPES, 1 ; CC.PTR) THEN
CRT 'Account name: ':VALID.CC.NAMES<1,CC.PTR>
END ELSE
CRT 'Account name: NOT FOUND'
END
CRT 'Position: ':CC.PTR
CRT
CRT 'SECOND WAY'
LOCATE CC.ACCT.TYPE IN VALID.CC.TYPES<1> SETTING CC.PTR THEN
CRT 'Account name: ':VALID.CC.NAMES<1,CC.PTR>
END ELSE
CRT 'Account name: NOT FOUND'
END
CRT 'Position: ':CC.PTR
CRT
CRT 'THIRD WAY'
LOCATE(CC.ACCT.TYPE, VALID.CC.TYPES2, 1 ; CC.PTR) THEN
CRT 'Account name: ':VALID.CC.NAMES2<1,CC.PTR>
END ELSE
CRT 'Account name: NOT FOUND'
END
CRT 'Position: ':CC.PTR
CRT
CRT 'FOURTH WAY'
LOCATE CC.ACCT.TYPE IN VALID.CC.TYPES2<1> SETTING CC.PTR THEN
CRT 'Account name: ':VALID.CC.NAMES2<1,CC.PTR>
END ELSE
CRT 'Account name: NOT FOUND'
END
CRT 'Position: ':CC.PTR
END
And here are the results when you run the test program.
Equate with @VM: A}B}D}M}S}V
Equate with @VM: American Express}Carte Blanche}Diners
Club}Mastercard}Discover}Visa
Equate with `253: A}B}D}M}S}V
Equate with `253: American Express}Carte Blanche}Diners
Club}Mastercard}Discover}Visa
Account type: A
FIRST WAY
Account name: American Express}Carte Blanche}Diners
Club}Mastercard}Discover}Visa
Position: 1
SECOND WAY
Account name: NOT FOUND
Position: 2
THIRD WAY
Account name: American Express
Position: 1
FOURTH WAY
Account name: American Express
Position: 1
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/