>Is there a way to save an object reference into a cursor? Something like this:
>
>
lo = CREATEOBJECT("Form")
>CREATE CURSOR c_example (oData g)
>INSERT INTO c_example (oData) VALUES(lo)
>
>SCAN
> c_examples.oData.BackColor = RGB(255,255,0)
>ENDSCAN
>
>
>
>The only way I know how to do it is in some way like this when going through a table:
>
lo = CREATEOBJECT("Form")
>CREATE CURSOR c_example (cDataObj c(20))
>
>lcName = SYS(2015)
>PUBLIC &lcName
>&lcName = lo
>INSERT INTO c_example (cDataObj) VALUES(lcName)
>
>SCAN
> lcObj = ALLTRIM(cDataObj)
> &lcObj..BackColor = RGB(255,255,0)
>ENDSCAN
>
>
>Is there a way to do it through objects?
Basically yes, but it's several hundred lines of code in some class.
The idea is to use AMEMBERS to parse the object, TRASNSFORM / PADL to create text that could be used as VFP prg to create the parameters.
Tricky is child objects, collections and circular references.
The product of it is a text block that could be run with EXECSCRIPT
I use it to store form settings of any sort.
See if you can create it. Otherwise I would need to export in a sort of VFPX project.
Lutz
Update
And I run into problems with decimal lenght, SET POINT, type of property with .NULL. value and so on.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]