Getting key values from a tableΒΆ
table_get_key() |
Copy key values from a table to the source file buffer |
SYNTAX
table_get_key(table_id, row)
This function can only be used with tables whose source object is a file. Its purpose is to store the key values for a currently visible row of the table.
It copies the key values of the record whose fields are stored in the specified row of the table into the default buffer of the source file. The default buffer has the same name as the file, and is allocated to it automatically. The program can then read the record from the file, locked or unlocked, or use the key values for any other purpose.
The row must be an integer value in the range 1 to table_id->rows. This range represents the actual rows currently visible on the table (not the total number of table lines). So, to store the values currently displayed in the fourth row of the table, assign the value 4 to row. See Table size.
Typical uses of this function are:
1 |
In the EV_SELECT event to retrieve the key values of the selected row. See Table events and functions. |
2 |
After a new value has been assigned to table_id->topline, to retrieve the key values of the new top line. |
The function returns OKAY (0) if the operation was successful, or ERROR (1) if the row is out of range or the table source object is not a file.
RELATED TOPICS |