User Tools

Site Tools


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

AssignLeftToRight

blk2blue.jpg

The AssignLeftToRight method copies the contents of each “left” field to its corresponding “right” 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:     AddPair, AddItem, List

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