National Instruments 320682C Musical Toy Instrument User Manual


 
Formatting and I/O Library Chapter 2
LabWindows/CVI Standard Libraries 2-30 © National Instruments Corporation
Return Code
-1
Error.
Parameter Discussion
fileHandle is the file handle that was returned from the OpenFile function. If fileHandle=1,
data is written to STDOUT and no prior OpenFile call is needed.
buffer is the buffer from which to write data.
count specifies number of bytes to write. The count parameter overrides the buffer size in
determining the number of bytes to write. Buffers containing embedded NUL bytes are written in
full. count must not be greater than buffer size.
Using This Function
For files opened in ASCII mode, each LF character is replaced with a CR-LF combination in the
output. In this case, the return value does not include the CR character written to the output.
An error can indicate a bad file handle, an attempt to access a protected file, an attempt to write
to a file opened as ReadOnly, or no more space left on disk.
WriteLine
int n = WriteLine (int fileHandle, char *lineBuffer, int numberofBytes);
Purpose
Writes numberofBytes bytes from lineBuffer to a file and then writes a linefeed to the file.
Parameters
Input
fileHandle
integer File handle.
lineBuffer
string Data buffer.
numberofBytes
integer Number of bytes to write.
Return Value
n
integer Number of bytes written.
including line feed.