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.

1-903 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

If the NO.DUPS keyword was specified when the alternate key index was<br />

created, <strong>UniBasic</strong> will not write a record that would create a duplicate index<br />

key. Instead, the ON ERROR clause executes (or the program aborts if ON<br />

ERROR is not coded) and the STATUS function returns a value of 10. RFS<br />

does not support NO.DUPS.<br />

Parameters<br />

The following table describes each parameter of the syntax.<br />

Parameter Description<br />

expr Specifies an expression to write to the record.<br />

ON | TO file.var Specifies a file to which to write the expression.<br />

If you do not specify a file.var, UniData writes to the default file. If<br />

no default file is open, a fatal error occurs.<br />

A default file is one for which no file variable is assigned in the OPEN<br />

statement.<br />

record.ID.expr Specifies a record to receive the expression. If the record already<br />

exists, the new expression you specify with expr replaces the existing<br />

information. If the record you specify does not exist, UniData creates<br />

the record.<br />

ON ERROR<br />

statements<br />

Specifies statements to execute in the event of a fatal error condition<br />

(such as the file is not open, an I/O error occurs in the write process,<br />

or the record contains a duplicate alternate index key). If you do not<br />

specify the ON ERROR clause, the program terminates under fatal<br />

error conditions.<br />

When including WRITE statements within a transaction, you must<br />

code an ON ERROR clause that notifies the user and takes appropriate<br />

action, such as stopping the transaction. If the transaction is not<br />

aborted by the ON ERROR clause, processing continues, and the<br />

transaction could commit inappropriately.<br />

WRITE Parameters

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

Saved successfully!

Ooh no, something went wrong!