Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object not available in procedure
Message
 
 
To
14/05/2008 08:13:33
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01316922
Message ID:
01316925
Views:
13
This message has been marked as a message which has helped to the initial question of the thread.
Check the help on variable scope, specifically LOCAL. It doesn't matter that the variable is holding an object reference, the rules are still the same.

In this case PRIVATE is the scope you want.

>I have a PRG that the object goes out of scope when a procedure is called. Do I need to pass it in somehow?
>
>
>LOCAL myObject
>
>MyObject = CREATEOBJECT("MyClass")
>
>DO MyProcedure
>
>RETURN
>
>PROCEDURE MyProcedure
>
>   * MyObject is not available
>
Previous
Reply
Map
View

Click here to load this message in the networking platform