Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
M.var=bof() or eof() or m.var WHAT???
Message
From
12/07/2001 21:53:57
 
 
To
12/07/2001 20:07:06
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00530035
Message ID:
00530061
Views:
17
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
* This function returns true if either or both Blah1 or Blah2 are true.
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform