Question about Option Values.
I'm trying to retrieve the selected option value as a text from a table that I've created. I found three methods and functions that I'm trying to put together to do this, but I don't think I've got it right.
I found the SELECTSTR function, which says it allows you to pull an indexed item from a comma separated list. I then found in the description of the Option type that the FieldRef will return a numeric value representing the item in the list that was selected, and then the OPTIONSTRING method, which supposedly returns the option string associated with the field. I tried combining them like so...
textValue := SELECSTR(rec."Option Field",rec."Option Field".OPTIONSTRING)
It's telling me that this is not valid syntax...
Does anyone know how to do this?
Comments
An option in reality (=in the DB and also how to use it) is an 0-based-integer. So the first option=0, the second option=1, and so on.
If you want the string of the option, you have to use it like above.
If you want to test if an option has a value, or put a value in it, you should do this: It is possible to put rec."Option Field" into an integer-field and an integer field into an option. So if you need to pass an option to a function as a parameter, in the function you can receive it as an integer and then use that integer in the function. An example:
And to call it:
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Thanks Kriki!
If your want the option field text represented by the option value use this syntax: FORMAT(rec."yourOptionField");