Consultor Eletrônico



Kbase P120724: How to copy field values from a record to another?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/24/2006
Status: Unverified

GOAL:

How to copy field values from a record to another?

GOAL:

How to assign a whole record in one statement?

GOAL:

How assign all the fields of a record without listing the fields individually?

CAUSE:

If you are using more than one frame for the table, you have to specify from which frame you want to assign the data, perhaps using the DO WITH FRAME <frame-name> syntax or with the FRAME option of the ASSIGN statement.

FIX:

Use the ASSIGN record statement. For example, the following code creates a new Customer and assigns values of the last record to it except for two fields:
FIND LAST Customer.
DISPLAY Customer EXCEPT Comments.
/* Create a new customer */
CREATE customer.
/* Copy all customer-data from screen-buffer to the new customer */
ASSIGN
Customer EXCEPT CustNum Comments.
OUTPUT CLOSE.