Formatting and I/O Library Chapter 2
LabWindows/CVI Standard Libraries 2-24 © National Instruments Corporation
carriage-return/linefeed combination will be treated as a linefeed. If fileHandle is zero, the line
will be read from the standard input.
lineBuffer is a character buffer. It should be large enough to contain maximum#Bytes bytes
plus an ASCII NUL.
ReadLine returns the number of bytes read from the file, including discarded bytes, but
excluding the linefeed. Hence, the return value will exceed maximum#Bytes if and only if bytes
are discarded.
If no bytes are read because the end of the file has been reached, ReadLine returns -2. If an
I/O error occurs, ReadLine returns -1.
Scan
int n = Scan (void *source, char *formatString, targetptr1,…,targetptrn);
Purpose
Scans a single source item in memory and breaks it into component parts according to format
specifiers found in a formatString. The components are then placed into the target parameters.
Parameters
Input source Type must match formatString contents
formatString string.
Output targetptr1,…,targetptrn Types must match formatString contents.
Return Value
ninteger Number of target format
specifiers satisfied.
Return Code
-1 Format string error.
Using This Function
The return value indicates how many target format specifiers were satisfied, or -1 if the format
string is in error. A complete discussion of this function is in the Using the Formatting and
Scanning Functions section later in this chapter.