void to.key( long
Use this to change the key of the main table without user interaction. The key_number argument specifies the new key.
When changing the key of the main table within the on.main.table() function, you must use db.change.order() instead. Also, to change the key of a table other than the main table, you must use db.change.order().
You can also use execute(change.order) to change the key of the main table. In this case, the user selects the new key.
Note that during execution of the ADD.SET, MODIFY.SET and MARK.DELETE commands, the current key is saved and the primary key becomes the current key. After the database has been updated, the 4GL engine restores the saved key.
4GL library function.
You can use these functions only in 4GL scripts and only in programs of type 1, 2, and 3. You can use the function in the following event subsections:
You can use this function only in 4GL scripts. You cannot use it in programs of type 4. You can use the function in the following event subsections on.choice, after.choice init.form, before.form, after.form on.entry.