Method
Compares two records.
Category
Records
Syntax
Function CmpRec(ByVal hTable As Long, ByVal hDstRec As Long, ByVal
hSrcRec As Long) As Boolean
hTable
The handle to the table.
hDstRec
The handle to a record.
hSrcRec
The handle to the record that hDstRec is to be compared with.
Example
createTestTable
CF1.OpenTable hTable, .Text1(cf.TableNoCreate).Text
hRecord = CF1.AllocRec(hTable)
hRecord2 = CF1.AllocRec(hTable)
tmpVar = "green"
CF1.AssignField hTable, hRecord, 1, tmpVar
CF1.AssignField hTable, hRecord2, 2, tmpVar
tmpVar = "yellow"
CF1.AssignField hTable, hRecord, 2, tmpVar
CF1.AssignField hTable, hRecord2, 1, tmpVar
tmpVar = CF1.CmpRec(hTable, hRecord, hRecord2)
If VarType(tmpVar) = vbBoolean And tmpVar = True Then
logWr "CmpRec OK"
Else
logWr "CmpRec failed"
End If
CF1.FreeRec hRecord
CF1.FreeRec hRecord2
CF1.CloseTable hTable
deleteTestTable
Comments
hDstRec and hSrcRec must be handles to records from the same table.
If the contents of the records are the same, the function returns
TRUE. If the contents are not the same, it returns FALSE.