You are not logged in.
Pages: 1
Hello Aranud,
The comment for the TSQLTable.RowFromID function:
/// get the Row index corresponding to a specified ID
// - return the Row number, from 1 to RowCount
// - return RowCount (last row index) if this ID was not found or no
// ID field is available
function RowFromID(aID: TID): integer;
I'm confused by this line:
return RowCount (last row index) if this ID was not found.
How to distinguish the situation where the ID value is found in the last row (which equals to RowCount), and "if this ID was not found" quoted above?
Thanks.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
It works as designed.
Purpose of this method was to select the current row in a grid.
This is the meaning of "Row" here: we are dealing about UI, not
If there is no matching ID, the latest row is selected.
I've added the aNotFoundMinusOne optional parameter to TSQLTable.RowFromID to return -1 if aID is not found.
See https://synopse.info/fossil/info/7382477aa058b41c
Offline
Thanks ab.
I was using it to locate the row index by ID value.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Pages: 1