Special Nature of the Formatting and Scanning Functions
The formatting and scanning functions are different in nature from the other functions in the LabWindows/CVI libraries. With few exceptions, each LabWindows/CVI library function has a fixed number of parameters, and each parameter has a definite data type. However, each formatting and scanning function takes a variable number of parameters, and the parameters can be of various data types. This variable number of parameters gives the formatting and scanning functions versatility.
For instance, a single Scan function call can perform the following disparate operations:
- Find the two numeric values in the string "header: 45, -1.03e-2" and place the first value in an integer variable and the second value in a real variable.
- Take the elements from an integer array, swap the high and low bytes in each element, and place the resulting values in a real array.
To perform these operations, each formatting and scanning function takes a format string as one of its parameters. In effect, a format string is a mini-program that tells the formatting and scanning functions how to transform the input arguments into the output arguments. For conciseness, format strings are constructed using single-character codes. The Formatting Functions and Scanning Functions sections describe these codes in detail.
Refer to the example code for formatting and scanning functions to help you learn about the special nature of LabWindows/CVI Formatting and I/O Library functions.