Eg:
- Code: Select all Expand view RUN
Upper( c1 ) == Upper( c2 )
Converting the strings to upper or lower case every time adds overhead to the application.
FW_StrICmp() avoids the need for this conversion and gives exactly the same results as the normal coparison.
Syntax-1:
- Code: Select all Expand view RUN
FW_STRICMP( c1, cOperator, c2, [lExact] ) --> lTrue
Usage:
- Code: Select all Expand view RUN
SET EXACT OFF
? FW_STRICMP( "FiveTech Software", "=" "FIVETECH" ) --> .t.
? FW_STRICMP( "FiveTech Software", "==" "fivetech" ) --> .f.
? FW_STRICMP( "FiveTech Software", "=" "FIVETECH", .t. ) --> .f.
We can use all other comparison operators like >, <, >=, <=, <>, !=. Comparison respects the current setting of SET EXACT, which can be overridden by the last parameter. In all cases, the results are identical to normal comparison with case conversion.
Syntax-2:
FW_STRICMP( c1, c2, [lExact] ) --> nResult, which can be -1, 0, 1 meaning less than, equal to, greater than.
- Code: Select all Expand view RUN
FW_STRICMP( "aaa", "AAA" ) //--> 0