basic.write Statement/BASIC Program

basic.write

Command basic.write Statement/BASIC Program
Applicable release versions: AP, R83
Category BASIC Program (486)
Description writes the item from the dynamic array specified in "dynamic.array.variable" into the specified file, using the item-id specified in the "id.expression".

If the file.variable is not specified, the default file.variable is used.

The "writeu" statement writes a dynamic array into the specified file.variable and keeps the update lock set. "writeu" additionally keeps items locked that were locked by a previous "readu", "readvu", or "matreadu" statement.

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.
Syntax write{x}{u} dynamic.array.variable on {file.variable,} id.expression
Options
Example
write item on customer.file,item.id

This statement unconditionally writes the contents of the array.variable 
"item" on the "customer" file with a specified 
"item.id". If the item doesn't exist, it adds it. If the item 
exists, it overwrites it.

readu item from customer.file,item.id else stop
...
begin case
case action = 'fs'
writeu item on customer.file,item.id
case action = 'fi'
write item on customer.file,item.id
return
case action = 'ex' 
release customer.file,item.id
return
end case
...

Since a "writeu" does not clear the item lock, a "release" 
or an explicit "write" is required to clear the lock before 
continuing.
Purpose
Related basic.matwrite
basic.array.references
basic.read
basic.matread
basic.default.files
basic.writeu
basic.statements
basic.id.expression
basic.file.variable
basic.array.variable
basic.extract
basic.delete.function
basic.begin.work