FindByRowId
See Also: RowId, RowId Helper Functions
Purpose
Finds a record for a table by its RowId.
Return Type
Syntax
FindByRowId( {hTable}, {RowId} )
Where:
- {hTable} is the table number of some open database table.
- {RowId} is a value of type RowId.
Example
Function RefindLastRecord returns Boolean
RowId riCustomer
Boolean bFound
Get priLastRow to riCustomer
If (not(IsNullRowId(riCustomer))) begin
Move (FindByRowId(Customer.File_Number, riCustomer)) to bFound
End
Function_Return bFound
End_Function
Notes
FindByRowId attempts to find a record by performing a find EQ based on a record's RowId. The function is passed a table number and a RowId, and it returns a boolean determining if a row was found.
If a record is found, the function:
- Returns True.
- Sets the Found indicator to True.
- Has an active row loaded in the table's buffer.
If a record is not found, the function:
- Returns False.
- Sets the Found indicator to False.
- Clears all columns in the table's buffer.
If a null RowId is used in the function, no row is found and the table buffer is cleared.
The RowId value passed must be a valid RowId for the finding table. Passing a RowId from a different table yields undefined behavior.