When you compare strings, the comparison is case sensitive. Leading blanks are significant, but trailing blanks are not.
Assume City1 is "Austin" and City2 is "AUSTIN". Then:
City1=City2
returns FALSE.
To compare strings regardless of case, use the Upper or Lower function. For example:
Upper(City1)=Upper(City2)
returns TRUE.
For information about these functions, see “Using DataWindow expression functions”.
Assume City1 is "Austin" and City2 is " Austin ". Then the expression:
City1=City2
returns FALSE. PocketBuilder removes the trailing blank before making the comparison, but it does not remove the leading blank.
To prevent leading blanks from affecting a comparison, remove them with one of the Trim functions: Trim or LeftTrim.
For example:
Trim(City1)=Trim(City2)
returns TRUE.
To compare strings when trailing blanks are significant, use an expression such as the following to ensure that any trailing blanks are included in the comparison:
City1 + ">" = City2 + ">"
For information about these functions, see “Using DataWindow expression functions”.
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |