Hail all,
Need some help figuring out the deal with this LOOKUP() function, I've used it many times before, but just can't for the life of me figure out whats wrong with it. I'm sure it's something simple I just need a fresh set of eyes:
LOOKUP() is returning a 0, even though I know for a fact 'chevy' is in the list. The list is also comma delimited.
Need some help figuring out the deal with this LOOKUP() function, I've used it many times before, but just can't for the life of me figure out whats wrong with it. I'm sure it's something simple I just need a fresh set of eyes:
Code:
DEF VAR v-found AS INT.
DEF VAR v-list AS CHAR.
FIND FIRST table1 NO-LOCK WHERE
table1.fld1 = 'cars' AND
table1.fld2 = 'gm' NO-ERROR.
IF AVAIL table1 THEN
ASSIGN v-list = table1.fld3. /* for this example, a list of gm brands */
DISPLAY v-list FORMAT "X(20)".
FIND FIRST table2 NO-LOCK WHERE
table2.fld1 = 'john' NO-ERROR.
IF AVAIL table2 THEN DO:
DISPLAY table2.fld2.
ASSIGN v-found = LOOKUP(table2.fld2,v-list). /* lets say table2.fld2 = 'chevy' */
DISPLAY v-fnd.
END.
LOOKUP() is returning a 0, even though I know for a fact 'chevy' is in the list. The list is also comma delimited.