basic.matwrite
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
User Comments
What do you think?
Share your experience or ask a question by using the form below.
Login to leave your comments.
