Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CreateObject() vs NewObject()
Message
 
To
24/08/2007 13:49:55
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Miscellaneous
Thread ID:
01249678
Message ID:
01250300
Views:
35
Mike,

>Nope. If the method does IF ",VCXNAME.VCX," $ ','+SET('CLASSLIB')+',' it can be almost as fast.

Here I go again <g>

As you have more and more classlibs, that IF will become slower and slower, while NewObject should keep a relatively constant speed, for if we are not using classlibs and procedure files, there is nothing to open/close, so I am not sure. By the way, shouldn't you remove your commas? Set("Classlib") returns, for me, the full path of the library, like this "X:\FOXV\CLASSES\SKYFORMS.VCX ALIAS SKYFORMS, X:\FOXV\CLASSES\SKYCLASSES.VCX ALIAS SKYCLASSES". You can see that with only 2 classlibraries open the string is already quite long, and as you should not close any classlib open for what I said before, you might end up with a huge string to scan.
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform