Hi Craig,
you know I'm feeling narky today so why not...
>X = BOF() OR EOF() OR THIS.TOPFILE
>IF M.X = .T.
> THIS.TOPFILE = .T.
>ELSE
> THIS.TOPFILE = .F.
>ENDIF
It just takes up that extra line :-))
But seriously, I often see code in production like your example and wonder "why?"
BTW, I know it was meant to explain to Todd what was going on, so I'm not having a go at you.
I really love this sort of coding...
FUNCTION Myfunction
LOCAL llRetVal
llRetVal = .F.
IF Blah1 OR Blah2
llRetVal= .T.
ELSE
llRetVal= .F.
ENDIF
RETURN llRetVal
I've seen that so often! ROFL!
In any case
THIS.TOPFILE = THIS.TOPFILE OR EOF() OR BOF()
would normally be best, since it may reduce the overall number of function calls.
>It can be rewritten as
>
>
>IF BOF() OR EOF() OR THIS.TOPFILE
> THIS.TOPFILE = .T.
>ELSE
> THIS.TOPFILE = .F.
>ENDIF
>
>
>>This statement is contained in a class generated through the Application Wizard.
>>
>>
>>THIS.TOPFILE = BOF() OR EOF() OR THIS.TOPFILE
>>
>>
>>I have never seen a statement setting a variable/property = something with additional 'or' conditions.
>>
>>Could someone explain?
>>
>>Many thanks,
>>
>>Todd