writevu Statement

The writevu form of this statement is identical to writev, except that the item remains locked.

Syntax

writevu exp ON {file.var ,} ID.exp, ac.exp

Parameter(s)

exp

Expression to write to the specified file.

file.var

File to write to. Contains the item expressed in ID.exp. If omitted, the default file variable is used.

ID.exp

Item to write to. Contains the attribute expressed in ac.exp.

ac.exp

Attribute to write to.

Description

-1 can be used as the value of the attribute count expression. This appends a new attribute to the end of the item.

writevu requires that the entire item be read into temporary workspace so that it can be rebuilt with the new attribute value, before it is written back to the file.

A series of writevu statements addressing different attributes in the same item can get very slow because the item has to be reread for every writevu.

A further problem with writevu is that it is not atomic. A writevu, although faster, is equivalent to this fragment of BASIC code:

xx<attr> = str

writeu xx on file,item

Example(s)

writevu time() on control.file,’control.list’,3

See Also

Attribute Count Expression, Default File Variables, File Variable, ID Expression, matread Statement, readv Statement, release Statement, Statements and Functions, writev Statement