Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Do I need to release array of SCATTER/GATHER?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01550168
Message ID:
01550244
Views:
74
This message has been marked as a message which has helped to the initial question of the thread.
>Doesn't GATHER create array?

In my opinion it is much better to use SCATTER/GATHER NAME, which will create an object with the same properties as the fields in the table.

ie
LOCAL loRecord

USE Table && has fields PK, field1 and field2
SCATTER NAME loRecord MEMO

*** Now you can use it to replace or insert into another table

USE Table2 
GATHER NAME loRecord MEMO && Replace a record or

loRecord.PK = NewPK()

INSERT INTO Table2 FROM NAME loRecord && Inserts a new record


* at any time you can address or set the value of this properties as you would with any other object

loRecord.Field1 = 'NewValue' && etc.
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform