The ^IIF()" statement
-
- Posts: 143
- Joined: Tue Oct 10, 2017 12:44 pm
The ^IIF()" statement
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
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
-
- Posts: 143
- Joined: Tue Oct 10, 2017 12:44 pm
==> RE: The ^IIF()" statement
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
The ? on the right of the equals is a wildcard to match any single character.____Kathleen__R&R Support
-
- Posts: 143
- Joined: Tue Oct 10, 2017 12:44 pm
====> RE: The ^IIF()" statement
Kathleen,____ Thanks you for clarifying this ^*^ and ^?^ string comparison issue.____-Mel Smith__