>I have to work with a file that has 164 fields. I know: it needs normalization, but this is the government - we don't have time for efficiency!
>
>Is there an easy way to compare two records within the same file? I'd like to just say something like "IF Rec#1 = Rec#2 Do Something" - is this possible?
>
>Or will I have to compare them one field at a time?
You may open it in two workareas, provide the corresponding records are current, and, well, compare field by field. Then you have several options: you may scatter both to arrays and compare array elements, or do lots of Evals like this:
lEqual=.t.
=afields(aFlds)
for i=1 to fcount()
lEqual=lEqual and eval("alias1."+aFlds[i,1])==eval("alias2."+aFlds[i,1])
if not lEqual
exit
endif
endfor
Now lEqual should be .t. if they are equal. Still, this calculates two Eval()s for each field, and may be an overkill. I'd go for the scatter.