basic.%write.apdos

C Function/BASIC Program, Releases: AP/DOS

Writes to a DOS file.

Syntax

n=%write( file.handle, buffer, record.size)

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.

See Also

Command Name Type Description
basic.cfunc Definition can be called from a Pick/BASIC program or subroutine in AP/DOS and AP/Unix implementations using a syntax similar to that of normal C.
basic.cfunction Definition Declare a list of C functions.
basic.system Function Displays status of system-controlled variables.

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.