11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

READFWD<br />

Syntax<br />

READFWD dyn.array.var [FROM file.var] [ON ERROR statements] {THEN<br />

statements [END] | ELSE statements [END]}<br />

Description<br />

The first READFWD command retrieves the alternate key set by SETINDEX, and<br />

then each subsequent READFWD retrieves the next alternate key value in the index.<br />

UniData reads the corresponding record into a dynamic array, and then assigns the<br />

record ID to the @ID variable.<br />

Note: This command does not check for locks. If you are operating in a multiuser<br />

environment, you must use record locks to prevent more than one user from accessing<br />

the same record at the same time. For more information about the <strong>UniBasic</strong> record<br />

locking, see Developing <strong>UniBasic</strong> Applications.<br />

Using this command in a loop, a <strong>UniBasic</strong> program retrieves records in ascending<br />

order based on an indexed attribute.<br />

Before executing READFWD, you must set a pointer to an alternate key value with<br />

the SETINDEX command. The SETINDEX parameters BUFFER.KEYS and<br />

VALIDATE.KEY determine, respectively, whether the buffering mechanism is used<br />

and whether keys are validated when READFWD executes. For details, see<br />

SETINDEX.<br />

READFWD sets the STATUS function return value to 10 if <strong>UniBasic</strong> detects a<br />

duplicate alternate index key value and you have executed the ECL command<br />

DUP.STATUS ON during the current session.<br />

1-610 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!