User Tools

Site Tools


assignrighttoleft_copy_from_right_fields_to_left_fields_.htm
Navigation:  ABC Library Reference > FieldPairsClass > FieldPairsClass Methods >====== AssignRightToLeft (copy from “right” fields to “left” fields) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

AssignRightToLeft

blk2blue.jpg

The AssignRightToLeft method copies the contents of each “right” field to its corresponding “left” field in the List property.

Implementation:

For AddPair pairs, the “left” field is the first (left) parameter of the AddPair method; the “right” field is the second (right) parameter of the AddPair method. For AddItem pairs, the “left” field is the only parameter of the AddItem method. The “right” field is the FieldPairs supplied copy of the “left” field.

Example:

Fields.AddPair(CUST:Name,  CustQ.Name)  !establish Name pair

Fields.AddPair(CUST:Phone, CustQ.Phone) !establish Phone pair

Fields.AddPair(CUST:ZIP,  CustQ.ZIP)  !establish ZIP pair

!some code

IF ~Fields.Equal              !compare field pairs

 CASE MESSAGE('Abandon Changes?',,,BUTTON:Yes+BUTTON:No)

 OF BUTTON:No

  Fields.AssignRightToLeft       !copy changes to CUST (write) buffer

 OF BUTTON:Yes

  Fields.AssignLeftToRight       !restore original to CustQ (display) buffer

 END

END

See Also:     AddPairAddPairadd_a_field_pair_FieldPairsClass_, AddItemAddItem_add_a_field_pair_from_one_source_field_, List

assignrighttoleft_copy_from_right_fields_to_left_fields_.htm.txt · Last modified: 2021/04/15 15:56 by 127.0.0.1