Variable names can be specified as TBDISPL parameters, as follows:
- POSITION(crp-name)
- Specifies the
name of the variable in which TBDISPL is to store the row number (CRP
number) of the current selected row. If there are no selected rows,
the CRP will be at the top and the row number returned is zero.
- ROWID(rowid-name)
- Specifies the name of the variable in which TBDISPL is to store
the rowid of the current selected row.
The difference between a CRP number and a rowid is as follows:
- A CRP number is an ordinal number; that is, the first row has
a CRP number of 00000001, the second row has a CRP number of 00000002,
and so on. CRP numbers are associated with "slots" in a table,
rather than particular rows. If a new row is inserted after the first
row, that new row now has a CRP number of 00000002. What had been
row 00000002 is now row 00000003, what had been row 00000003 is now
row 00000004, and so on.
- A rowid is a nominal value that uniquely identifies a row. This
value stays with the row, even if the row has other rows inserted
before it. Note, however, that this identifier is not saved on permanent
storage by the TBSAVE or TBCLOSE service.