Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Application Object Best Practices
Message
From
27/07/2011 08:18:20
 
 
To
27/07/2011 06:07:04
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MySQL
Application:
Desktop
Miscellaneous
Thread ID:
01519029
Message ID:
01519305
Views:
76
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform