FS_WRITE
Write a record to a logical file
WSupported on Windows
|
USupported on Unix
|
VSupported on OpenVMS
|
NSupported in Synergy .NET
|
xcall FS_WRITE(record, number, [level], [channel][, error])
Arguments
record
The record to write. (a)
number
The number of the record to write. (n)
level
(optional) The file-stack level to which to write. (n)
channel
(optional) The file-stack channel. If not passed, the default file-stack channel is used. (n)
error
(optional) Returned with one of the following error flags: (n)
0 = No error occurred.
1 = Not a file-stack channel.
2 = File stack not active.
4 = No logical file stacked.
5 = Illegal record number.
6 = Invalid file-stack level.
Discussion
FS_WRITE writes a record to a logical file.
It is assumed that the size of the data transfer is the size of the accessed logical file’s record length, as specified in FS_OPEN.
If the current (highest) level is being accessed, and number is greater than the highest record number written to this level, a new EOF point will be set for the level.
Only the current (highest) level can extend the logical file length. Lower levels (logical files) can only update existing records.
If error is not passed, and an error occurs, a fatal program error is generated.
Examples
The following example writes the data in page to record number 5 in file-stack level page_level. If page_level is not the current (highest) level, record number 5 must be an existing record, since you can only extend the logical file length of the highest file-stack level.
xcall fs_write(page, 5, page_level,, sts)