>My co-worker came to me with a weird problem. He has some code that should blow up, but is running and I can not explain it.
>
>He has a Department field in table Depts. In this case, Depts.Department="A"
>
>He has a field that indicates if a department should print or not. In this case, it's NOPRINT and NOPRINT = .F.
>
>His statement is in a loop and it looks like this:
>
>IF ALLTRIM(depts.Department) == NOPRINT
> SKIP
>ENDIF
>
>If you are in the debugger, the program breezes right past the IF and it evaluates to TRUE, effectively skipping the record.
>
>"A"==.F. should give an error.
>
>In the watch window, the same expression - ALLTRIM(depts.Department) == NOPRINT - shows up as an error. There isn't any ON ERROR set either. The same expression in the command window returns an error.
>
>Is there any reason why the program would evaluate the illegal expression to TRUE?
>
>Thanks,
>Tim
Could it be that you have NOPRINT defined as constant in .h file? Though field should still have precedance.
If it's not broken, fix it until it is.
My Blog