a) == for ANSI SQL-92 standard comparison: trailing blanks is ignored b) = with SET ANSI ON : is identical to a) c) = with SET ANSI OFF : strings are equal if one corresponds to the beginning of the other ( blank is a character like other ).II) Focus attention on cursor control commands (SCAN.. REPLACE .. ) WHILE and
a) == precise comparison: two strings they must be identical ( blank is a character like other ); point 7. does not have affect on result. b) = with SET EXACT ON : this is identical to point I)a) comparison rule; point 7. does not have affect on result. c) = with SET EXACT OFF : strings are equal if right string corresponds to the beginning of the left string ( blank is a character like other ). This is similar to I)c) with Point 7. restriction.For point I) and II), any result not change if VFP use indexs or not use indexs.
a) with SET EXACT OFF the seek use II)c) comparison rule with sKeySearched like right member. b) with SET EXACT ON the seek use another comparison rule: if LEN(sKeySearched)<LEN(sKeyString) then use II)b) comparison rule, else comparison not match ( like II)c) comparison rule )The III)b) comparison rule is different to any comparison rule on I) and II) contexts.
INDEX ON cField TAG tag1 SET EXACT ON * next code is not correct SEEK m.sKeySearched && use III)b) SCAN WHILE cField=m.sKeySearched && use II)b) ... ENDSCAN * workaround corection SEEK RTRIM(m.sKeySearched) && use III)b) but now it is like II)b) SCAN WHILE cField=m.sKeySearched && use II)b) ... ENDSCANNOTE: My English is uncertain, but I hope to me it are explained.