Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing an Object Around
Message
 
To
04/09/2008 20:40:42
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01345022
Message ID:
01345026
Views:
12
>I need to go down about 4 or 5 procedures to get some information that is then needed back at the first call. I was fine when it was just one value as I just returned it as I came back up the stack. Now I need more than one value and started to code it using an object. I'm just having trouble knowing whether I'm doing it the right way. Also, where do I kill/release each object in this scenario, and does it matter that I name the object the same for all calls?
>
>oObject = Proc1()
>
>Proc1
>oObject = Proc2()
>RETURN oObject
>
>Proc2
>oObject = Proc3()
>RETURN oObject
>
>etc...
>
>UPDATE: I just had a thought. Does it make more sense to have a _SCREEN object (or something like that) and just change the values as needed?

That's similar to what I've done in the past. I create one object that is kinda global - like an "oApplication" object right when my app fires up. Anything that needs to be seen throughout the whole app I put in there - both methods and properties. Not sure if this is really the "proper" way to do things, but it sure makes life easier....
ICQ 10556 (ya), 254117
Previous
Reply
Map
View

Click here to load this message in the networking platform