Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add Properties to Scatter Name Object?
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00516849
Message ID:
00516893
Views:
20
>Before I read your post (I'm still playing with this), I tried this and I almost get there:
>
>Public oData
>Select PreImport
>oData = CreateObject("Record")
>For nFld = 1 to FCount()
>	oData.AddProperty(Field(nFld))
>EndFor
>oData.AddProperty( "BillCode" , "B")
>oData.AddProperty( "Org_Unit" , "Unk   ")
>oData.AddProperty( "OrigDate" , Date() )
>oData.AddProperty( "OrigTime" ,Time() )
>oData.AddProperty( "OrigAid" , "XXXX")
>oData.AddProperty( "ModDate" , Date() )
>oData.AddProperty( "ModTime" , Time() )
>oData.AddProperty( "ModAid" , "XXXX")
>Define Class Record as Custom
>EndDefine
>
>But my problem now is that I can't just "Scatter Name oData" because the object I just made gets obliterated. I think I will have to "Scatter Name oDataTemp" and then iterate through that, copying values from it to my oData object, and then "Gather Name oData" to my result table. Kind of kludgy. Is that the only way?

Yep, unfortunately. That's why, in my previous post I mentioned that you'd have to pass the original object as a parameter with CREATEOBJECT() and initialize the property values in the Init event.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform