basic.matwrite

Statement/BASIC Program, Releases: AP and R83

Writes dimensioned array to file.

Syntax

{mat}write{x}{u} array.variable on {file.variable,} id.expression

Description

writes an item into the specified file.variable.

This statement may optionally be written 'matwrite' or 'write'. If 'mat' is omitted, a matrix write can be determined by the definition of the variable, 'array.variable'. If no 'dim' statement appears, it is automatically treated as a 'dynamic' array.

If the file.variable parameter is omitted, the default file.variable is used.

The 'matwriteu' statement is identical to the 'matwrite' statement, except the item remains locked. The 'u' form keeps the item locked if it was previously locked by a 'readu', 'readvu', or 'matreadu' statement within the same program.

The array is truncated to the last non-null array element. All trailing null elements are deleted. If the array is defined by a 'file' statement, the 'file.variable' is not used.

The 'writex', 'matwritex' and 'matwritexu' 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.

Example

dim customer.item(30)
matread customer.item from customer.file,item.id else ..
customer.item(1)=newname
customer.item(30)=date()
matwrite customer.item on customer.file,item.id

See Also

Command Name Type Description
basic.matread Statement Reads item into dimensioned array.
basic.dim Statement Declares a dimensioned array.
basic.matbuild Statement Converts dimensioned array to dynamic array.
basic.matparse Statement Converts dynamic array to dimensioned array.
basic.id.expression Definition An expression which derives an item-id.
basic.release Statement Releases group/item lock(s).
basic.file.variable Definition Defines file location from previous 'open' statement.
basic.default.files Definition used by any file-access Pick/BASIC statement when a specific file variable is not specified.
basic.array.dimensioned Definition a table where the contents of the elements can be altered (replaced) but the position of each element is fixed.
basic.statements Definition Definition of statements and functions.
basic.write Statement Writes dynamic array to file.
basic.matwriteu Statement see 'matwrite'.
basic.array.references Definition Referencing arrays.
basic.mat Statement Assigns data to a dimensioned array.
basic.array.variable Definition References a dimensioned array.
basic.begin.work Statement Starts a transaction

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.