National Instruments 320682C Musical Toy Instrument User Manual


 
Chapter 2 Formatting and I/O Library
© National Instruments Corporation 2-35 LabWindows/CVI Standard Libraries
f real number. This source or target specifier indicates that the corresponding parameter is
a real number, or if rep is present, a real array. The function performs conversions to
ASCII when converting to or from the string format %s.
c character. This source or target specifier indicates that the corresponding parameter is an
integer with one significant byte, or, if rep is present, an array of 1-byte integers. The
function does not perform conversion to ASCII when converting to or from the string
format %s. The byte is copied directly to or from the string.
Formatting Modifiers
modifiers are optional codes used to describe the nature of the source or target data. If you
use them, you must enclose the modifiers in square brackets and place them immediately after
the format code they modify. If one format specifier requires more than one modifier, enclose all
modifiers in the same set of brackets.
There is a different set of modifiers for each possible format specifier.
Formatting Integer Modifiers (%i, %d, %x, %o, %c)
bn Specify Length. The b integer modifier specifies the length of the integer
argument, or the length of an individual integer array element, in bytes. The
default length is 4 B; therefore, simple 4 B integers do not need this modifier.
The modifier b2 represents short integers. The modifier b1 represents single-byte
integers.
in Specify Array Offset. The i integer modifier specifies an offset within an
integer array argument. It indicates the location within the array where processing
begins.
n
is the zero-based index of the first element to process. Thus,
%10d[i2] applied to a source integer array reads the 10 integer values from the
third through the twelfth elements of the array. The i modifier is valid only if
rep is present. If you use the i modifier with the z modifier, then n is in terms
of bytes.
z Treat String as Integer Array. The z integer modifier indicates that the data
type of the corresponding argument is a string. Nevertheless, the data in the string
is treated as an integer array. The z modifier is valid only if rep is present.
rn Specify Radix. The r integer modifier specifies the radix of the integer
argument, which is important if the integer was to be converted into string format.
Legal radixes are 8 (octal), 10 (decimal, the default), 16 (hexadecimal), and 256 (a
special radix representing single 8-bit ASCII characters).
wn Specify String Size. The w integer modifier specifies the exact number of bytes
in which to store a string representation of the integer argument, in the event that