Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help. The Destroy event of my session object keeps firin
Message
From
09/01/2001 16:44:42
 
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00461058
Message ID:
00461426
Views:
11
>>I think I have solved this problem now.
>>
>>It looks like it was because, oDS, my object reference was going out of scope when the forms load event finished.
>>
>>I have made oDS public now and all seems ok.
>>
>>Should I have made oDS a property of my form instead of a variable.
>>Would this slow things down?
>
>Yes, a form property would be the preferred way to deal with something that only belongs to the form. A PUBLIC variable could cause you trouble. No, I doubt that speed would be an issue here.

Indeed, depending on whether you'll need a different instance of your object in each form, or you need to access (and mantain a general state, for example) the same one from any other component, you can make it global.

In that last case, anyway, it's prefereble to add it to a global application object or maybe to the _Screen. That way it is much protected from the rest of the environment.

Business object are generally private, as it usually represent entities like customers, vendors, etc. But if you have one representing the company that's using your system (and supossing that just one company can be active at a given time), you have a good candidate for a general instance.

Hope this helps.
Previous
Reply
Map
View

Click here to load this message in the networking platform