The ^IIF()" statement

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
Mel_Smith_(Guest)
Posts: 143
Joined: Tue Oct 10, 2017 12:44 pm

The ^IIF()" statement

Post by Mel_Smith_(Guest) » Thu Apr 17, 2003 7:27 pm

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__

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: The ^IIF()" statement

Post by kfleming » Fri Apr 18, 2003 6:14 am

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

Mel_Smith_(Guest)
Posts: 143
Joined: Tue Oct 10, 2017 12:44 pm

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

Post by Mel_Smith_(Guest) » Sat Apr 19, 2003 11:25 pm

Kathleen,____ Thanks for clearing up this issue for me !!____ BTW, is there some implication for the question mark ^?^ character also ??____Thanks,____-Mel Smith__

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

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

Post by kfleming » Sun Apr 20, 2003 6:23 am

The ? on the right of the equals is a wildcard to match any single character.____Kathleen__R&R Support

Mel_Smith_(Guest)
Posts: 143
Joined: Tue Oct 10, 2017 12:44 pm

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

Post by Mel_Smith_(Guest) » Wed Apr 23, 2003 9:17 am

Kathleen,____ Thanks you for clarifying this ^*^ and ^?^ string comparison issue.____-Mel Smith__

Post Reply