|Command||basic.%write.apdos C Function/BASIC Program
Applicable release versions: AP/DOS
|Category||BASIC Program (486)|
|Description||writes the number of bytes designated by "record.size" from "buffer" to the file specified by the "file.handle", which was returned by a previous call to "%open()".
The function returns the number of bytes actually written. If "n" is less than the "record.size", there was not enough space to write all the contents of buffer to the file. For additional information refer to the MS-C library reference manual under WRITE().
Special characters should not be used by the "%read" and "%write" statements. For instance, when reading from an MS-DOS file into a buffer in a Pick/BASIC program, there must be no Segment Marks (x'FF') in the file being read. When writing to an MS-DOS file from a Pick/BASIC program, ensure that no characters that have a special meaning to MS-DOS are in the buffer to be written. Currently, all the data conversions must be done manually.
If any errors are encountered while using any of the C function, the "system(0)" function contains the error message number.
|Syntax||n=%write( file.handle, buffer, record.size)|