Page 1 of 1

The ^IIF()" statement

Posted: Thu Apr 17, 2003 7:27 pm
by Mel_Smith_(Guest)
I use RRW 9.0 and Clipper 5.2e____ In one of my reports I use a database with a 1-byte character field ^myfield^. In this field in the databsase there is an asterisk (i.e., ^*^)____ After a couple of hours of frustrating work, I find I get different logical values for the following part of a calculated field:____ IIF(myfield="*",DOSOMETHING(),DOOTHERSTUFF())____ (This always results in .true. whatever myfield contains)____ IIF("*" $ myfield, etc, etc )____ (This results in a correct logical value)____Can anyone comment on this please ?____-Mel Smith__

=> RE: The ^IIF()" statement

Posted: Fri Apr 18, 2003 6:14 am
by kfleming
When an asterisk is used after the equals sign, R&R treats it as a wild card that matches any number of characters. Used before the $ is contained in operator, it is treated as a literal character.____Kathleen__R&R Support

==> RE: The ^IIF()" statement

Posted: Sat Apr 19, 2003 11:25 pm
by Mel_Smith_(Guest)
Kathleen,____ Thanks for clearing up this issue for me !!____ BTW, is there some implication for the question mark ^?^ character also ??____Thanks,____-Mel Smith__

===> RE: The ^IIF()" statement

Posted: Sun Apr 20, 2003 6:23 am
by kfleming
The ? on the right of the equals is a wildcard to match any single character.____Kathleen__R&R Support

====> RE: The ^IIF()" statement

Posted: Wed Apr 23, 2003 9:17 am
by Mel_Smith_(Guest)
Kathleen,____ Thanks you for clarifying this ^*^ and ^?^ string comparison issue.____-Mel Smith__