F-WRITE

Writes the contents of the specified file buffer as an item on disk.

Syntax

F-WRITE file-buffer-number

F-W file-buffer-number

Syntax Elements

file-buffer-number
is the number of the file buffer to which the file was assigned by an F-OPEN statement. Valid numbers are 1 to 47, but note that 19 and 20 are reserved for system Procs.

Operation

If the specified file buffer has not been opened, the Proc terminates with an error message.

If an item lock has been set by F-UREAD command, it is released.

The item-id is not specified because it is assumed to be in attribute zero of the file buffer. If attribute zero is null, no record is written.

The item-id can be placed in attribute zero of the file buffer in one of two ways:

The F-WRITE command does not alter the contents of the file buffer.

There is no ELSE condition with the F-WRITE command.

Caution

When running this command, you need to be aware of the effects of any file triggers that might be run as consequence. See File Triggers for more information.

Example

F-WRITE 3

This example writes the item contained in file buffer 3 to the file defined by the F-OPEN statement for file buffer 3. The item-id is in &3.0. If &3.0 is null, no action is taken.