version 1.5
OP Goto record (connectionID; tableID; recordNumber; bindID; lockStatus) Longint
Parameter | Type | Description | |
connectionID | Longint | Connection ID with target server | |
tableID | Longint | Number of the table in the database | |
recordNumber | Longint | Absolute record number in the table | |
bindID | Longint | Bind list ID | |
lockStatus | Longint | Lock status = 1 means the record is locked | |
Function result | Longint | Error code result for the function |
Description
OP Goto record makes recordNumber the current and only record in the selection.
If you pass 0 in bindID or omit the last two parameters, OP Goto record changes only the current record pointer. If you pass a valid bind list ID, the routine will also download the fields accordingly. In this case, if the access mode to the table is read/write, the routine will additionally try to give you access to the record in read/write mode. If this last operation is successful, the routine returns 0 in lockStatus. If the record is already in use by another process, the routine returns 1 in lockStatus.
By testing the lockStatus parameter, you know whether or not you can subsequently modify or delete the record using OP Update record or OP Delete record.
If you obtained the current record in read/write mode, you must release the record for the other processes by using OP Unload record once you are done with the record (unless you deleted it).
Error Codes
If OP Goto record executes successfully, it returns 0. Otherwise, this function returns one of the following errors:
Error Code | Description |
-9972 | Table number is out of range. |
-10003 | Record is out of range. |
10128 | The 4D Open for 4th Dimension package has not been initialized. |
10136 | The connection does not exist. |
10154 | This command cannot be executed right now. |
Example
See example for OP Delete record.
See Also
GOTO RECORD, OP Current Record Number, OP Delete record, OP Get record numbers, OP Goto selected record, OP Load record, OP Single query.