[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
+---------------------------------+
| GATHER |
+---------------------------------+
GATHER FROM <array> | MEMVAR
[FIELDS <field name list>]
[MEMO]
-----------------------------------
Moves contents of memory variables or array elements to database fields.
-----------------------------------
FROM <array>
Copies elements from array starting with first element into
corresponding fields of record. The contents of the first array element
are copied to the first field of the record, the second array element is
copied to the second field and so on.
MEMVAR
Transfers data to current record from memory variables with same names
as fields in database. Memory variables with the same names as fields
in a database can be easily created by including MEMVAR or BLANK in the
SCATTER command.
The contents of each memory variable are copied to the field with the
same name as the memory variable. If a memory variable with the same
name as a field in the database doesn't exist, the field is left
unchanged.
FIELDS <field name list>
Replaces contents of specified fields with contents of array elements
or memory variables.
MEMO
Includes memo fields in GATHER process. If MEMO is not included, memo
fields are skipped when GATHER copies data from an array or memory
variables to the current record.
+---------------------------------+
| Program Example |
+---------------------------------+
This example illustrates SCATTER and GATHER. SCATTER is used to copy
data in the current record into memory variables. The data is then
displayed in a window where it can be edited. When the last field is
exited, the data is copied back into the current record using GATHER
(unless Escape is pressed). The TO clause is not used with SCATTER and
GATHER in this example because TO is only used when copying data to and
from arrays.
SET TALK OFF
USE customer
SCATTER MEMVAR
DEFINE WINDOW menter FROM 6,10 to 18,70 PANEL
ACTIVATE WINDOW menter
@ 1,3 SAY 'Customer: ' GET m.company
@ 3,3 SAY 'Address: ' GET m.address1
@ 5,3 SAY 'City: ' GET m.city
@ 7,3 SAY 'State: ' GET m.state
@ 7,18 SAY 'Zip: ' GET m.zip
@ 9,13 SAY 'Press <Escape> to discard changes'
READ
IF LASTKEY() != 27
GATHER MEMVAR
ENDIF
DEACTIVATE WINDOW menter
USE
-----------------------------------
See Also: APPEND FROM ARRAY, COPY TO ARRAY, DECLARE, DIMENSION, SCATTER
-----------------------------------
See Also:
APPEND FROM ARRAY
COPY TO ARRAY
DECLARE
DIMENSION
SCATTER
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson