| Format |
| | Getptr [expr] [ for DATABASE ] [/Qualifiers ...] |
| | or | |
| | Getptr [expr] [ using TAGNAME ] [/Qualifiers ...] |
| | expr | Pointer index of the record to get. If you do not indicate a pointer index, GETPTR gets the next record pointed to. If the expression is zero the pointer index is reset. |
| | for DATABASE | Optional clause indicating the database from which to get a record. The database must have been specified in the database section with the /POINTER qualifier. If you do not indicate a database, IDML gets a record by pointer from the first database specified with /POINTER. |
| | using TAGNAME | The name tag of the pointer file opened with OPENPTR. |
| | The internal variable %POINTER is sest to the current pointer index. If the current record for this database has been modified, it is written back to the record stream before any other record operation takes place. If an error occurs during this write-back operation (e.g. duplicate key, record not locked for write, etc.), an error is generated for this statement. The record remains current, but is now considered to be unchanged so that the next record operation will not attempt another write-back. |
| Qualifiers |
 | /Fail=LABEL | Label to which to branch if the statement fails. If LABEL is %EXIT, exit the routine or loop. If in a loop, and LABEL is %CONTINUE, continue the loop. If not in a loop, and LABEL is %CONTINUE, an error message displays. | | |
| | /Succeed=LABEL | Label to which to branch if the statement succeeds. If LABEL is %EXIT, exit the routine or loop. If in a loop, and LABEL is %CONTINUE, continue the loop. If not in a loop, and LABEL is %CONTINUE, an error message displays. | | |
| | /Nofail | Do not signal an error. Instead, set the internal variable %FAIL. | | |
| | /Lock=(lock_options, ...) | Use the following lock options to lock the record. |
| | exclusive |  | Lock against all other record streams except READ_REGARDLESS. |
| | manual | | Records remain locked until explicitly unlocked. |
| | none | | Records are not to be locked. |
| | nonexistent | | Proceed with the operation even if the record does not exist (RMS relative files only). |
| | nowait | | Do not wait if the record is locked (return an error). |
| | read | | Lock the record for reading while allowing other record streams to read but not modify (ignored if write also specified). |
| | read_regardless | | Read records even if another record stream has them locked. |
| | wait=n | | Wait n seconds before returning an error if the record is locked. |
| | write | | Lock the record for writing while allowing other record streams to read but not modify. |