Equinox Online Help - Language Reference - A to Z

Home

IsSameRecord

Applies to
SyntaxIsSameRecord
Action[Function] Determines whether the current record inside a subtable block is the same as the current record outside the block.
ScopeOnly usable in subtables.
Notes

When you use a subtable block, Equinox temporarily changes the home table. You can select a new current record for this table, but Equinox still remembers the current record in the old table. When you exit the block, the old current record becomes current again.

Sometimes, you may need to use a subtable block where the home table inside the block is the same as the home table outside. Thus, you may effectively have two selected records for the same table: one inside the block and one outside. In this situation, you can use the IsSameRecord function to determine whether the two current records are the same. If they are, then the function returns True. If they are different then False is returned.

You can also use this function when the home table for the block is a child or the parent of the home table outside the block. In this case, True is returned if the records are hierarchically related. Note that you cannot use two relationally-linked tables, since there may not be a one-to-one relationship.

If an error occurs, an error number is stored in the system workarea SysError.

CategoryRecord location
See Also CountRecords, CurrentTableName, FindRecord, FindRecordLock, GroupFindRecord, IsLookup, IsRecord, Lookup, LookupWrite, SameRecord
Example

This example finds the customer records whose names start with the same letter as the current customer and prints (in the Print window) those whose name is nearly the same. The Customer table is accessed both inside and outside the subtable block.

string firstletter(1), name

firstletter = CustName[1]
name = CustName

subtable customer
SetIndex IcustName
FindRecord GE, firstletter

while not syserror
if CustName[1] <> firstletter then exit while
if Compare(name, CustName) > 80 then
if not IsSameRecord then Print CustName
end if
NextRecord
end while
end subtable | customer