GETPTR
Get a record from a database using a pointer file.

Format
 Getptr [expr] [ for DATABASE ] [/Qualifiers ...]
 or
 Getptr [expr] [ using TAGNAME ] [/Qualifiers ...]
 exprPointer 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 DATABASEOptional 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 TAGNAMEThe 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=LABELLabel 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=LABELLabel 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.
 /NofailDo not signal an error. Instead, set the
internal variable %FAIL.
 /Lock=(lock_options, ...)Use the following lock options to lock the record.
 exclusiveLock against all other record streams except READ_REGARDLESS.
 manualRecords remain locked until explicitly unlocked.
 noneRecords are not to be locked.
 nonexistentProceed with the operation even if the record does not exist (RMS relative files only).
 nowaitDo not wait if the record is locked (return an error).
 readLock the record for reading while allowing other record streams to read but not modify (ignored if write also specified).
 read_regardlessRead records even if another record stream has them locked.
 wait=nWait n seconds before returning an error if the record is locked.
 writeLock the record for writing while allowing other record streams to read but not modify.

Example
 Getptr
 ! Get the next record in the first /Pointer database.
 Getptr ptr
 ! Get a record in the first /Pointer database
 ! using the pointer index indicated by the
 ! variable "ptr".
 Getptr for HOURS
 ! Get the next record in the "HOURS" database.
 Getptr ptrinx using PTR
 ! Get a record using the pointer file PTR.
 ! Opened with the OPENPTR statement.