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.

READBCK<br />

Syntax<br />

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

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

Description<br />

The first READBCK command retrieves the alternate key set by SETINDEX, then<br />

each subsequent READBCK retrieves the previous alternate key value in the index.<br />

The corresponding record is read into a dynamic array, and the record ID is assigned<br />

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 <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 descending<br />

order based on an indexed attribute.<br />

Before executing READBCK, you must set the alternate key value with the<br />

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 READBCK executes. For details, see<br />

SETINDEX.<br />

READBCK 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 />

READBCK 1-599

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

Saved successfully!

Ooh no, something went wrong!