Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I Refer to a Custom Object Before its INIT is Finish
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00173320
Message ID:
00173369
Views:
21
Hi David,

The only inconsistency that was really going on turned out to be my intelligence. I combined the OneInstance library with my common library so everything would fire in a sequence by setting up just one custom object. The problem occurred every time I tested the OneInstance. I kept on getting a "variable not found" error, referring to my library object variable.

The cause of the trouble was with my ON SHUTDOWN clause, which was set to call a library routine, and is initialized BEFORE setting up the OneInstance code. Therefore, whenever the OneInstance fired when the application was being loaded twice, the program would shut down, and attempt to run the ON SHUTDOWN routine in an object variable that no longer existed!

After tracking down what was going on, everything works fine now. Thanks a lot for your help.

Michael

>What kind of inconsistency do you see? There really isn't a problem doing any of this, it's just a design concern once you tie an object to another that it is a permanent thing. You might look at the Design Patterns book for some ideas on how to reduce the impact on your design.
>
>>Thanks for writing. That works. By passing the first object's "THIS" to the second, I can refer to the first object before its variable is created. However, in my situation, the results are inconsistent. Perhaps this is one of those "issues" to which you referred. Therefore, I'll just file this away for future reference.
Previous
Reply
Map
View

Click here to load this message in the networking platform