CompareLikeFields function

Syntax

CompareLikeFields(from, to)

where from and to are constructions that reference rows of data on specific source and target records in the component buffer; each have the following syntax:

level, scrollpath, target_row

and where scrollpath is:

[RECORD.level1_recname, level1_row, [RECORD.level2_recname, level2_row, ]] RECORD.target_recname

To prevent ambiguous references, you can use SCROLL. scrollname, where scrollname is the same as the scroll level’s primary record name.

Description

Use the CompareLikeFields function to compare fields in a row on a specified source record to similarly named fields on a specified target record.

Note:

This function remains for backward compatibility only. Use the CompareFields record class method instead.

If all of the like-named fields have the same data value, CompareLikeFields returns True; otherwise it returns False.

Parameters

Parameter Description

from

A placeholder for a construction (level, scrollpath, target_row) that references the first row in the comparison.

to

A placeholder for a construction (level, scrollpath, target_row) that references the second row in the comparison.

level

Specifies the scroll level for the target level scroll.

scrollpath

A construction that specifies a scroll level in the component buffer.

target_row

Specifies the row number of each target row on its scroll level.

Returns

Returns a Boolean value indicating whether all of the like-named fields in the two records have the same data value.

Example

The following example compares the like-named fields in two rows on levels 1 (&L1_ROW) and 2 (&L2_ROW) and returns True if all of the like-named fields in the two rows have the same value.

&L1_ROW = 1;
&L2_ROW = 1;
If CompareLikeFields(1, RECORD.BUS_EXPENSE_PER, &L1_ROW, 2, RECORD.BUS_EXPENSE_PER, 1, RECORD.BUS_EXPENSE_DTL, &L2_ROW) Then
   WinMessage("The fields match.");
End-If;