11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

STATUS Function Return Values<br />

After you execute WRITE, the STATUS function returns one of the values described<br />

in the following table.<br />

Return<br />

Value Meaning<br />

0 Successful write.<br />

1 System error, such as a damaged file.<br />

2 Constraint violation. In this case, the <strong>UniBasic</strong> trigger subroutine returns a<br />

value of 0 in the parameter execstat, indicating that the WRITE is not<br />

allowed.<br />

3 Trigger execution error or unexpected return from trigger routine (for<br />

example, the trigger subroutine is not cataloged).<br />

10 Non-RFS files – WRITE created a duplicate alternate index key and ECL<br />

DUP.STATUS is on; or WRITE failed because a duplicate value exists in the<br />

index, and NO.DUPS was specified when the index was created.<br />

RFS files – WRITE created a duplicate value in the index, and ECL<br />

DUP.STATUS is on.<br />

STATUS Function Return Values<br />

Examples<br />

The following program segment is taken from the sample program in Appendix A,<br />

“Sample Program, in Developing <strong>UniBasic</strong> Applications. The statements update<br />

records that were previously locked with READU and release locks on the records.<br />

WRITE CLIENT.REC ON CLIENT_FILE,CLIENT_NUMBER<br />

WRITE ORDER.REC ON ORDERS_FILE,ORDER_NUMBER<br />

In the next example, the program statement writes the contents of the variable<br />

OVERSTOCK to the file named in variable FNAME as a record with ID OS:<br />

WRITE OVERSTOCK TO FNAME,"OS"<br />

WRITE 1-904

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

Saved successfully!

Ooh no, something went wrong!