Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine if an object exists
Message
 
 
To
10/05/1998 06:21:21
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00098172
Message ID:
00098389
Views:
37
Dragan,

Yes, I've used it in a classlib documentation tool, that builds a multilinked data structure and I use a member property that gets some of the classlib/form fields scattered to it. This way I can pass the class around as an entity. Try this:

use grid1 && test table with colums c1, c2, c3, c4

o1 = createobject( "data" )
scatter name o1.oDataRec

o2 = createobject( "data" )
skip
scatter name o2.oDataRec

? o1.oDataRec.c1
? o2.oDataRec.c1

define class data as custom
   oDataRec = .null.
enddefine


>Scatter Name oAnything - has anyone succeeded having this do something useful? I've played with it for a while, hoping to have an object like that to keep me olde values of all the open tables in a form, but I couldn't get this object to belong to a form at all - if it already belongs to a form, it won't scatter; if it doesn't, it becomes a private var to the method which created it, and I sure wouldn't like to make it a public var. With VFP completely lacking object cloning, this object can't be kept at all - trying to copy it to a form's member creates just a referrence to this oAnything, and goes .null. as soon as the method which created it exits.
>
>Has anyone managed to work around this? I have found not a workaround, but a much better solution for my particular case, but in general, I think I may use this Scatter Name somewhere, IF it behaved.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform