Hi Peter,
It looks like VFP uses internally a single routine to compare strings. Both, the "=" operator and ASCAN() seem to call this function. Therefore, inside a SELECT statement ASCAN() compares string according to the current SET ANSI setting. If you insert SET ANSI ON right before the select statement, you get the same result as with the SCAN loop.
BTW, you should add NOFILTER to the second SELECT statement. Otherwise, the code runs eternally, because VFP creates a filter.
--
Christof