Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Application Object Best Practices
Message
 
 
À
27/07/2011 06:07:04
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MySQL
Application:
Desktop
Divers
Thread ID:
01519029
Message ID:
01519305
Vues:
77
>With today's machines, the difference may be negligible, specially when we're talking about service objects which may not be accessed from tight loops.
>
>And when they are, getting an object reference to it into a variable, then using that variable inside the loop, will run the access method only once. IOW, instead of
>
>
for i=1 to 10000
>    oApp.oServiceObject.DoSomething()
>endfor
>which would fire the access method each time, we can do
>
loService=oApp.oServiceObject
>for i=1 to 10000
>    loService.DoSomething()
>endfor
I do the same, but I prefer to add intellisense to the code like this:
LOCAL loService AS MyServiceClass OF Application_Services.VCX
loService = oApp.oServiceObject
for i = 1 to 10000
    loService.DoSomething()
endfor
This helped me a lot to prevent typo's in the code.
Christian Isberner
Software Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform