frFieldRef = Fieldref sValue = Text[30] iTmpInt = Integer CASE frFieldRef.TYPE OF 'Option': BEGIN IF STRPOS(UPPERCASE(frFieldRef.OPTIONCAPTION),UPPERCASE(sValue)) > 0 THEN BEGIN IF frFieldRef.OPTIONCAPTION[1] = ',' THEN BEGIN iTmpInt := 2; END ELSE BEGIN iTmpInt := 1; REPEAT iTmpInt += 1; UNTIL STRPOS(UPPERCASE(SELECTSTR(iTmpInt,frFieldRef.OPTIONCAPTION)),UPPERCASE(sValue)) = 0; END; frFieldRef.VALIDATE(SELECTSTR(iTmpInt,frFieldRef.OPTIONCAPTION)); END; END;
Comments
If you need to VALIDATE then call this after the EVALUATE.
Haven't tried it myself but I think it might work
if i remenber well, it seams that FieldRef var respect the language code of the database... so try to use 'my value in my language' instead of 'my value'....
For instance i used to have a filter the next code :
and it worked......
But oh my foes and oh my friends, it gives a lovely light
to
as mentioned above.. If you evaluate the frfieldref.optioncaption instead of validating it one get an type error. But inserting the integer variable the code returns the correct option ..