HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

4- 106
until a carriage return is pressed before continuing. Any characters
typed are not echoed. Essentially, the report writer executes the ACCEPT
statement to accomplish the pause.
POSITION
The POSITION statement positions the record pointer of a specified file
at a specified record. The RESET option can reset the file to an empty
file.
Syntax
{
rnum
}
{BEGIN}
POSITION
#fnum
; {END }
{RESET}
Parameters
fnum
The file number that HP Business BASIC/XL uses to
identify the file. It is a numeric expression that
evaluates to a positive short integer.
rnum
A numeric expression. Positions record pointer at the
record specified by
rnum
.
BEGIN Positions record pointer at first record in the file.
END Positions record pointer at the EOF mark, beyond the
last record in the file.
RESET Positions record pointer at first record in the file and
immediately writes an EOF marker. All previous contents
of the file are lost following execution of the POSITION
statement with this option.
The POSITION statement is used to position the record pointer before a
sequential read or write to a file if the pointer is not already in the
desired position. The POSITION statement is unnecessary before a direct
read or write, because a direct read or write statement specifies a
record.
Examples
The following examples show the use of the POSITION statement.
10 POSITION #1; 10 ! Record pointer is at record 10.
20 POSITION #2; Nextrec ! Record pointer is at record indicated in Nextrec.
30 POSITION #3; BEGIN ! Record pointer is at the first record.
40 POSITION #4; END ! Record pointer is at the EOF mark.
50 POSITION #5; RESET ! Deletes the contents of the file. #5
PREDICATE
The PREDICATE statement aids in locking database items. Without this
statement, the PACK statement must be used to build a predicate string
for the DBLOCK statement. The TurboIMAGE/3000 database requires a
precise format for this string. The PREDICATE statement builds the
string in the correct format and requires only the relevant information.
An entire dataset, items within a dataset, or even a subset of an item
can be locked using the PREDICATE statement. Note that more than one
lock specification may be given at once. The string resulting from the
PREDICATE statement is used in the DESCRIPTOR clause of the DBLOCK
statement to lock the database.