Susan Joslyn wrote:

>> When a BASIC program in either U2 flavor attempts a write to a file that
cannot 
>> be written to the program bombs completely out to TCL and no information
is 
>> given about the file, nor about the specifics (is it the owner, the
group, 
>> the RWX permissions?).

I don't know about Universe (haven't worked with it in a few years), but in
Unidata, the "ON ERROR" clause of the various write statements is for just
this purpose.

ON ERROR statements - Specifies statements to execute in the event
of a fatal error condition (such as the file is not open, an I/O
error occurs in the write process, or the record contains a duplicate
alternate index key). If you do not specify the ON ERROR clause,
the program terminates under fatal error conditions.

STATUS Function Return Values
After you execute WRITE, the STATUS function returns one of the values
described in the following table.

Return 
Value   Meaning
0       Successful write.
1       System error, such as a damaged file.
2       Constraint violation. In this case, the UniBasic trigger subroutine
returns a value of 0 in the parameter execstat, indicating that the
WRITE is not allowed.
3       Trigger execution error or unexpected return from trigger routine
(for example, the trigger subroutine is not cataloged).
10      Non-RFS files - WRITE created a duplicate alternate index key
and ECL DUP.STATUS is on; or WRITE failed because a duplicate value
exists in the index, and NO.DUPS was specified when the index was
created.
RFS files - WRITE created a duplicate value in the index, and ECL
DUP.STATUS is on.
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to