If variable = A | B | C | Z (which doesn't work for me)
with out saying
If variable = A | variable = B | variable = C | variable = Z ???
I have a long list of good choices.
Thanks
If you can think of a delimiter character that will never appear in
any of the strings (e.g. '00'x), then you can do:
del = '00'x
set = del || 'A' || del || 'B' || del || 'C' || del || 'D' || del
if pos(variable, set) > 0 ...
That is too slick!
Thanks. Works like a champ.
Actually, it should be slightly improved. I missed a bit:
=====================================
del = '00'x
set = del || 'A' || del || 'B' || del || 'C' || del || 'D' || del
if pos(del || variable || del, set) > 0 ...
=====================================
Whilst the original is fine if the values are really single characters
(in which case the delimiters are not needed), it will give false
positives if the variable can be a substring of any of the possible
values. This fixes that. I just forgot to put the delimiters in the
pos call.
Thanks, that closes a small hole which I have now updated my code to
reflect.
if wordpos(translate(variable),'A B C Z')>0 then .....
The translate is there to ensure that a uppercase-to-uppercase
comparison is done.
Willy