Article # 176, added by Geoworks, historical record
| first |
previous |
index |
next |
last |
Use of wild cards in string searches
Many GEOS libraries (such as Pen, DataStore, and ContDB) support the use of wild cards in string searches. GEOS wild card values are defined as follows: typedef ByteEnum WildCard; #define WC_MATCH_SINGLE_CHAR 0x10 #define WC_MATCH_MULTIPLE_CHARS 0x11 #define WC_MATCH_WHITESPACE_CHAR 0x12 These wildcards tell the search mechanism to accept any character in the allotted space. For example, passing WC_MATCH_MULTIPLE_CHAR instructs the search mechanism to accept any number of random characters in that place in the search string. Example: /* get text from text object */ textLen = @call SearchText::MSG_VIS_TEXT_GET_ALL_PTR( buffer ); /* check for wild cards */ for ( i = 0; i < textLen; i++ ) { if ( buffer[i] == '*' ) { buffer[i] = WC_MATCH_MULTIPLE_CHARS; } } /* * You can now pass "buffer" as your search string * to a system level search routine. */