Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CreateObject() vs NewObject()
Message
De
24/08/2007 14:49:38
Mike Yearwood
Toronto, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Divers
Thread ID:
01249678
Message ID:
01250315
Vues:
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.

If newobject closes all open classlibs and then reopens them that has to be slower than scanning a string, especially if they're not compiled in an exe/app.

Picky, picky! ;) I'm only trying to use some pseudo pseudocode to say "detect if the specified vcx file name is already opened/available/whatever" which in this case is easier said in code.

How about "\VCXNAME.VCX" $ SET('CLASSLIB')
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform