Chapter 2 Formatting and I/O Library
© National Instruments Corporation 2-31 LabWindows/CVI Standard Libraries
Return Code
-1 I/O error.
Parameter Discussion
If numberofBytes is -1, only the bytes in lineBuffer before the first ASCII NUL are written,
followed by a linefeed.
fileHandle is the file handle that was returned from the OpenFile function. The file should be
opened in ASCII mode so that a carriage return will be written before the linefeed. If fileHandle
is 1, the line will be written to the STDOUT.
Using This Function
WriteLine returns the number of bytes written to the file, excluding the linefeed. If an I/O
error occurs, WriteLine returns -1.
Using the Formatting and Scanning Functions
You use data formatting functions to translate or reformat data items into other forms. Typical
usages might be to translate between data stored on external files and the internal forms which
the program can manipulate, or to reformat a foreign binary representation into one on which the
program can operate.
There are three subclasses of data formatting functions in the LabWindows/CVI Formatting and
I/O Library:
Formatting functions
Scanning functions
Status functions
You use formatting functions to combine and format one or more source items into a single
target item, and you use scanning functions to break apart a single source item into several target
items. The status functions return information regarding the success or failure of the formatting
or scanning functions.

Introductory Formatting and Scanning Examples

To introduce you to the formatting and scanning functions, consider the following examples.