Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to make Memory variables use Private Data Sessions
Message
From
15/11/2001 13:13:19
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00580254
Message ID:
00582245
Views:
53
Gerard,

There is more than one way to do this. I would not create a property on the form for each field in the table. I would create a property on the form that has an object, then I would have a property within that object for each field.

One method, as you have been told, is addproperty(). Another one, which I like for this sort of thing, is the SCATTER NAME command.

Add a property to the form, and call it oTable1.

In the load of the form:
select table1
scatter name this.otable1 blank
Now, you have an object that is contained within the form, and this object has a property for each field in the table. If you have this form opened more than one time, these objects will not conflict with each other.

Now, you can easily put data from the table at any time like this, and put the data back to the table (or view, for that matter), using the GATHER NAME command.
scatter name this.otable1
Word of warning: It may not be safe to have a field by the name of "name". I think it may wreak havoc with this method, or the addproperty() method.

HTH,


>Is there a way to dynamically, at run time, create Properties and make them private to the form ?
>
>If this is possible, I could cycle through each relevant file, and make each field a Property of the form.
>
>Regards,
>
>Gerard
>
Steve Gibson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform