DICT Question / Problem / Strangeness (OpenInsight Specific)
At 06 MAY 1999 11:43:32AM B. Cameron wrote:
Using OI 3.5 and have two tables… BOOKS & TITLES.
Books=Title Codes
Titles=Author Codes
In Dict for books there is a Symbolic named AUTHOR_CODES
@ANS=XLATE( "TITLES" , {TITLE_CODE} , 5 , X)
In Dict for books there is also a symbolic named AUTHOR_1
@ANS=XLATE( "TITLES" , {TITLE_CODE} , "AUTHOR_1" , "X" )
where Author_1 in the TITLES dict will grap the first value .
AUTHOR_CODES works unless Books/{TITLE_CODE} is null and I get bounced into the debugger…
ENG0010:RTP16 Line1 Variable has not been assigned a value.
BUT AUTHOR_1 works regardless. Maybe I am missing the obvious.
Any ideas?
At 07 MAY 1999 04:38AM Oystein Reigem wrote:
B,
@ANS=XLATE( "TITLES" , {TITLE_CODE} , 5 , X)
X must be "X".
It seems one gets the "Variable has not been assigned a value" message when the fourth parameter (the variable X in your case) is undefined, and at the same time the second parameter ({TITLE_CODE} in your case) is not a key (null in your case).
It seems the Xlate function doesn't check the fourth parameter unless it needs to use it, i.e, when the second parameter is not a key.
And when it does check the fourth parameter it seems every defined value else than "X" works as "C". So if you by chance had a variable X in you program, you would probably get the "C" behaviour, where Xlate returns the key when the key doesn't exist. In your case null. And no debugger.
Well, life's full of coincidences.
- Oystein -
At 07 MAY 1999 12:08PM BC wrote:
Oystein,
Ahhh, I knew that!
Yup it was the obvious. I actually copy and pasted those into notepad
and compared byte for byte and still missed the quotes.
Argh! But thanks for the obvious.
Bruce