AssignRightToLeft (copy from "right" fields to "left" fields)


Top  Previous  Next

 

AssignRightToLeft

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:     AddPairAddPair__add_a_field_pair_FieldPairsClass_, AddItemAddItem___add_a_field_pair_from_one_source_field_, List