writeu Statement

The writeu form of the write statement writes a dynamic array into the specified file variable and keeps items locked that were locked by a previous readu or readvu statement.

Syntax

writeu dyn.array.var on {file.var,} ID.exp {onerr.clause}

Parameter(s)

dyn.array.var

Item to write to the specified file.

file.var

File onto which the dynamic array variable is written. If not specified, the default file variable is used.

ID.exp

Item-ID to assign to the new item being added to the file.

onerr.clause

An optional onerr.clause can be specified, which consists of the clause onerr followed by a statement block. The clause is taken if the update fails because the data source is unavailable (as can be the case if the file is remote), or if a callx correlative applied to the file fails because of an inputerr statement.

Description

This statement unconditionally writes the contents of the array variable item on the customer file with a specified item-ID. If the item does not exist, it is added. If the item exists, it is overwritten.

The write and writeu statements all have the property of waiting until the actual disk update takes place before continuing execution of the program. They are used for critical write-through, such as error-logging.

If the file updated performs a callx correlative and that subroutine does an inputerr, then the FlashBASIC or BASIC program performing the writeu statement drops immediately to TCL in the default case. If the onerr.clause is present, then that clause is taken in the inputerr case.

Because a writeu does not clear the item lock, a release or an explicit write is required to clear the lock before continuing.

Example(s)

writeu item on customer.file,item.ID