Hi,
A time ago we migrated from Foxpro 2.6 to 8. With this migration we saw that the SCATTER VAR wasn’t “public” anymore. With the migration we miss used the READ to continue the “public” effect of the m. VAR’s. But now we are planning to migrate to SQL Server, with this migration I also would like to make use of the Foxpro 8 way of storing data on forms and memory.
A while ago I already asked how the way would be to approach this. One of the suggestions was to SCATTER the data to an object and to add this object as an property to the form. I tried some examples but I can’t figure out how it really works:
What I do is the following:
The structure of the table at this moment is just 1 field called runo_nr which is a string.
1. In the load of the first form I have:
USE "f:\order08.dbf\db\12102007.dbf" ALIAS "table" SHARED IN 0
SELECT "table"
SCATTER NAME oTable
AddProperty(oTable, "myProperty")
In my world this should created a property “myProperty” to access the data that was scattered to the object oTable…
2. In the click event of the button on the form I have this:
WAIT WINDOW thisform.myProperty.runo_nr
But I get the message that the property myProperty doesn’t exist.
Why cant I use this property, it should already be added via addproperty ????
Second, how can I copy this data to another form?
Maybe like: DO FORM form2 NAME oForm2 WITH thisform.myProperty
And in the load of the 2nd form:
PARAMETERS oTable
AddProperty(oTable, "myProperty")
Is this valid?
---------------------
In vb I solve this by making a class module and making a Public VAR in the form that is a type “oTable”, and pass it to functions/forms “byref”
---------------------
I know this is a dummy question but I keep banging head against it So if you could please help or suggest a better way to do this I would be very grateful!
A time ago we migrated from Foxpro 2.6 to 8. With this migration we saw that the SCATTER VAR wasn’t “public” anymore. With the migration we miss used the READ to continue the “public” effect of the m. VAR’s. But now we are planning to migrate to SQL Server, with this migration I also would like to make use of the Foxpro 8 way of storing data on forms and memory.
A while ago I already asked how the way would be to approach this. One of the suggestions was to SCATTER the data to an object and to add this object as an property to the form. I tried some examples but I can’t figure out how it really works:
What I do is the following:
The structure of the table at this moment is just 1 field called runo_nr which is a string.
1. In the load of the first form I have:
USE "f:\order08.dbf\db\12102007.dbf" ALIAS "table" SHARED IN 0
SELECT "table"
SCATTER NAME oTable
AddProperty(oTable, "myProperty")
In my world this should created a property “myProperty” to access the data that was scattered to the object oTable…
2. In the click event of the button on the form I have this:
WAIT WINDOW thisform.myProperty.runo_nr
But I get the message that the property myProperty doesn’t exist.
Why cant I use this property, it should already be added via addproperty ????
Second, how can I copy this data to another form?
Maybe like: DO FORM form2 NAME oForm2 WITH thisform.myProperty
And in the load of the 2nd form:
PARAMETERS oTable
AddProperty(oTable, "myProperty")
Is this valid?
---------------------
In vb I solve this by making a class module and making a Public VAR in the form that is a type “oTable”, and pass it to functions/forms “byref”
---------------------
I know this is a dummy question but I keep banging head against it So if you could please help or suggest a better way to do this I would be very grateful!