Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code Efficiency Question
Message
De
15/03/2001 08:45:20
 
 
À
15/03/2001 08:15:49
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00485113
Message ID:
00485286
Vues:
9
Hmmmmm....

I never would have thought it.

>Hi John,
>
>oTest = CREATEOBJECT([Test])
>
>WAIT WINDOW IIF([abc] = [abc], oTest.TestMe(), [No go])
>
>DEFINE CLASS Test AS CUSTOM
>	FUNCTION TestMe()
>		RETURN [Got it]
>	ENDFUNC
>ENDDEFINE
>
>
>>Hi Spencer,
>>
>>AFAIK, calling a method from the middle of an IIF() won't work to begin with. IIF() is designed to return expressions, not execute methods.
>>
>>
>>>Anyone have a considered response to the following?
>>>
>>>Given that in FoxPro an immediate IF, IIF(), is more efficient than an equivalent IF...ELSE, I had a question.
>>>
>>>Would this strategy, in fact, actually be more efficient in conditionally calling a form method. For example, would
>>>
>>> =iif( SomeCondition, SomeObject.Refresh(), .F. )
>>>
>>>have some efficiency advantage (however trivial) over
>>>
>>> if ( SomeCondition )
>>> SomeObject.Refresh
>>> endif
>>>
>>>I fully appreciate that likely of greater concern are issues of code readability, maintainability, etc. than negligible speed improvements.
>>>My question is really just for a point of knowledge. Thanks.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform