WRITEU
The WRITEU statement allows a program to write a record into a previously opened file.
An existing record lock will be preserved.
COMMAND SYNTAX
WRITEU variable1 ON|TO { variable2,} expression {SETTING setvar} {ON ERROR statements}
SYNTAX ELEMENTS
variable1 is the identifier holding the record to be written.
variable2, if specified, should be a jBC variable that has previously been opened
to a file using the OPEN statement. If variable2 is not specified then the default file is assumed.
The expression should evaluate to a valid record key for the file.
If the SETTING clause is specified and the write fails, setvar will be set to one of the following values:
Incremental File Errors
128 |
No such file or directory |
4096 |
Network error |
24576 |
Permission denied |
32768 |
Physical I/O error or unknown error |
NOTES
If the statement fails to write the record then any statements associated with the ON ERROR clause are executed.
The lock maintained by the WRITEU statement will be released by any of the following events:
- the record is written to by the same program with WRITE, WRITEV or MATWRITE statements.
- the record lock is released explicitly using the RELEASE
statement.
- the program stops normally or abnormally.
See also: READU, MATREADU,
RELEASE
EXAMPLES
OPEN "Customers" ELSE ABORT 201, "Customers"
OPEN "DICT Customers" TO DCusts ELSE
ABORT 201, "DICT Customers"
END
WRITEU Rec FROM DCusts, "Xref" Setting Err ON ERROR
CRT "I/O Error[":Err:"]"
ABORT
END
JBC
|