Formatting and I/O Library Chapter 2
LabWindows/CVI Standard Libraries 2-4 © National Instruments Corporation
described in detail in the Using the Formatting and Scanning Functions section later in this
chapter.
You may find the formatting and scanning functions more difficult to learn than other
LabWindows/CVI functions. To help you in this learning process, read the discussions in the
Formatting and I/O Library Programming Examples section at the end of this chapter.
Formatting and I/O Library Function Reference
This section gives a brief description of each of the functions available in the LabWindows/CVI
Formatting and I/O Library. The LabWindows/CVI Formatting and I/O Library functions are
arranged alphabetically.

ArrayToFile

int status = ArrayToFile (char *fileName, void *array, int dataType,
int numberOfElements, int numberOfGroups,
int arrayDataOrder, int fileLayout, int colSepStyle,
int fieldWidth, int fileType, int fileAction);
Purpose
Saves an array to a file using various formatting options. The function handles creating, opening,
writing, and closing the file. The file can later be read back into an array using the
FileToArray function.
Parameters
Input fileName string File pathname.
array void * Numeric array.
dataType integer Array element data type.
numberOfElements integer Number of elements in array.
numberOfGroups integer Number of groups in array.
arrayDataOrder integer How groups are ordered in file.
fileLayout integer Direction to write groups in file.
colSepStyle integer How data on one line are separated.
fieldWidth integer Constant width between columns.
fileType integer ASCII/binary mode.
fileAction integer File pointer reposition location.