It doesn't work because the field does not accept wildcards.
> Depending on whether a variable length field (1 to 6 characters)
> contains the letter L, I want to be able to insert different text. I
[quoted text clipped - 3 lines]
>
> Why does this not work?
CODE is a field and and it appears that you can only have one wildcard
asterisk in the string. You can have an asterisk and more than one question
mark to represent single characters. Thus if Code was 'yellow' "??l*" would
work, "*w" would work , "y*" would work "y*w" would work, but "*l*" doesn't
work.

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<
AA2e72E - 07 Oct 2004 15:55 GMT
Thanks Graham.
I can get round with this:
{IF CODE = "L*" "HAS L" {IF CODE = "?L*" "HAS L" {IF CODE ="??L*" "HAS L" ….
More IF statements }}}
This gets very messy.
Is there any way I can use INSTR?
> It doesn't work because the field does not accept wildcards.
>
[quoted text clipped - 11 lines]
> work, "*w" would work , "y*" would work "y*w" would work, but "*l*" doesn't
> work.
macropod - 07 Oct 2004 21:46 GMT
Hi,
Testing whether a string contains a specified sub-string means testing for
the sub-string at each position in the string. AFAIK there is no way around
testing for the sub-string at specified positions. You could reduce the
number of nested IF tests by using (nested) OR tests, but I doubt that would
achieve much. Alternatively, you could sum a series of IF test results and
avoid nesting the IF tests altogether, as in:
{={IF CODE = "L*" 1 0}+{IF CODE = "?L*" 1 0}+{IF CODE = "??L*" 1 0}+{IF CODE
= "???L*" 1 0}+{IF CODE = "????L*" 1 0}+{IF CODE = "?????L*" 1 0}}
Cheers
> Thanks Graham.
>
> I can get round with this:
>
> {IF CODE = "L*" "HAS L" {IF CODE = "?L*" "HAS L" {IF CODE ="??L*" "HAS
L" ..
> More IF statements }}}
>
[quoted text clipped - 17 lines]
> > work, "*w" would work , "y*" would work "y*w" would work, but "*l*" doesn't
> > work.