Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Amembers() problem
Message
From
12/02/2019 12:22:54
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01666312
Message ID:
01666331
Views:
54
>>>I have an object with some properties.... In the debug i can see al properties, but when i use amembers it returns an incorrect number....11 instead the real number of properties contained in the object... Look at the image where you can see all the properties and the the amembers() result...
>>
>>How are you getting the object reference? In particular, if you're getting it from a FOR EACH loop, make sure that you use the FOXOBJECT keyword so you get a VFP object rather than a COM object.
>>
>>Tamar
>
>With the result of amembers() i make a simple for loop...
>i tried with for each but i had errors....have you an example about a for each with a simple object like mine iit is similar to that you can get from a scatter command

Some COM objects behave exactly like that - the properties aren't visible until you specifically ask for them. So those that you have visited (either as setting them as controlsources or specifically checking for them in the debugger) finally publish their properties after such a visit, not before that. Practically, the property doesn't really exist until you ask for it, and then it isn't quite a fixed property but rather a value that a PropertyGet() returns.

Which is why you should carefully re-read Tamar's question: if your object was a member of a collection, and you retrieved the reference in a for-each loop without AS FOXOBJECT, then it may become a COM object just because without it the collection is treated as a COM object. And then it mostly depends on the .tlb and other means of publishing its PEM.

So, how is your object created, stored, retrieved?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform