WRITEVU
The WRITEVU statement allows a program to write a specific field on a record in a
previously opened file. An existing record lock will be preserved.
COMMAND SYNTAX
WRITEVU variable1 ON|TO { variable2,} expression1, expression2 {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.
expression1 should evaluate to a valid record key for the file.
expression2 should evaluate to a positive integer number. If the number is greater
than the number of fields in the record, null fields will be added to variable1. If
expression2 evaluates to a non-numeric argument, a run time error will be
generated.
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 taken by the WRITEVU 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: MATWRITEU, RELEASE,
WRITE, WRITEU.
EXAMPLES
OPEN "Customers" ELSE ABORT 201, "Customers"
OPEN "DICT Customers" TO DCusts ELSE
ABORT 201, "DICT Customers"
END
WRITEVU Rec ON DCusts, "Xref",1 SETTING Err ON ERROR
CRT "I/O Error[":Err:"]"
ABORT
END
jBC
|