Equal (return 1 if all pairs are equal)

Top  Previous  Next



The Equal method returns one (1) if all pairs are equal and returns zero (0) if any pairs are not equal.


The Equal method simply calls the EqualLeftRight method which does all the comparison work. Therefore, there are two different methods (Equal and EqualLeftRight) that produce exactly the same result.

This provides an alternative calling convention for the FieldPairsClass and the BufferedPairsClass. The EqualLeftRight method name is consistent with the other comparison methods in the BufferedPairsClass and is provided for that purpose. See BufferedPairsClass Methods for more information.


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)


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


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



See Also:     EqualLeftRight