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:
01550247
Views:
56
>>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.
>
I didn't know of this syntax NAME and that it creates an object. Thank you for the lesson, Hugo.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform