Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best Practices
Message
From
08/02/2013 10:06:28
 
 
To
08/02/2013 09:45:22
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01565478
Message ID:
01565494
Views:
83
I am pretty sure that having too many classes in Set Classlib and too many Set Procedure will slow down the program. Often the slowdown is not big enough to waste any time on reducing it.

Using newobject() has no influence on the speed of the program, as far as I know, but you don't need the extra Set Classlib/Relese Classlib.

>Thanks for the feedback.
>
>I've used newobject() in other projects but this particular one is inherited code that, as I've mentioned before, uses set classlib.
>
>The thing that I'm still unsure of is, does using newobject() reduce system resources (or offer other advantages other than not having to set classlib) when compared to set classlib? If it does, then I'd attempt to switch over to using newobject() instead. If not, then I wouldn't bother.
>
>Mike
>
>
>>I used Set Procedure a lot earlier, but not anymore. I have only one procedure file active by Set Procedure To, if I need to add another one, I release it afterwards. I now always create separate prgs, or add the function to my functions.vcx.
>>
>>I also avoid Set Classlib, instead I use NewObject() whenever possible. In Thor you will find a Dynamic Snippet called NO which I created roughly a year ago. When I need to use a class in a classlib, I only type "NO myclass" and press F5 which I have programmed to invoke the dynamic snippet. I then get a picklist of every class in my project where myclass is found, and end up with the working code.
>>
>>>I'm working on an application that has many class libraries (VCXs) in the project. In the startup code, there is a SET CLASSLIB TO...ADDITIVE command for each and every VCX. The same goes for procedures; SET PROCEDURE TO ... ADDITIVE. Is there any drawback to doing it this way? I was wondering if there is any advantages of loading them on a "as needed" basis. Something along the lines of
>>>
>>>IF !"SOMECLASSLIB"$SET("Classlib")
>>> SET LIBRARY TO SOMECLASSLIB ADDITIVE
>>>ENDIF
>>>
>>>Then when its not needed, just RELEASE CLASSLIB SOMECLASSLIB. Would this be a more efficient use of RAM and/or does it affect the speed in any way?
>>>
>>>TIA,
>>>Mike
Previous
Reply
Map
View

Click here to load this message in the networking platform