>I went to work for a member of my Toronto FoxPro User Group. Another crappy code that thinks he's a genius.
>
>He asked me why one of his routines was slow. I pointed out innocently and with a willingness to be helpful that Rushmore uses the expression on the left to decide what indexes to use. He said I was wrong. A=B and B=A so therefore Rushmore must optimize the expression whether it was written as LOCATE FOR Upper(fieldname) = "washout walter" or LOCATE FOR "washout walter" = UPPER(fieldname). When I proved it by the manual and by scientific demonstration, he, like our stupidest members got mad at me. Idiots just gotta idiot.
This is not true in VFP9 (I remember something like that in a previous version, but I can't remember the details anymore and haven't got older VFP versions installed)
Very quick test in VFP9
nSec = SECONDS()
FOR nT = 1 TO 1000
LOCATE FOR UPPER(Field) = 'SOMEVALUE'
ENDFOR
? SECONDS() - nSec
nSec = SECONDS()
FOR nT = 1 TO 1000
LOCATE FOR 'SOMEVALUE' = UPPER(Field)
ENDFOR
? SECONDS() - nSec
Both ran in approx 40 ms, using the same index. Removing the index, the time needed is tenfold for both
It might be the case in VFP6, but not in VFP9.
Walter,