National Instruments 320682C Musical Toy Instrument User Manual


 
Formatting and I/O Library Chapter 2
LabWindows/CVI Standard Libraries 2-48 © National Instruments Corporation
x Discard Terminator. When applied to a target string, the x modifier specifies that
the terminating character be discarded before the next target is filled in. Using
%s>%s[xt59]%s[xt59] with the source string "abc;XYZ;", "abc" is placed
in the first target and "XYZ" is placed in the second target.
d Discard Data. When applied to a target specifier, the d modifier indicates that there
is no target argument to correspond to the target specifier. The data that otherwise is
placed in the target argument is discarded instead. The count returned by the
Scan/ScanFile/ScanIn functions will include the target specifier even if the
d modifier is used.
Scan, ScanFile, ScanIn—Asterisks (*) Instead of Constants in Format Specifiers
Often, a format specifier requires one or more integer values. The format specifier for an integer
array, for example, requires the number of elements (rep). You can use constants for these
integer values in format specifiers. Alternatively, you can specify an integer value using an
argument in the argument list. When you use this method, substitute an asterisk (*) for the
constant in the format specifier. Use the asterisk in the following format specifier elements.
rep For integer or floating-point arrays.
in For integer or floating-point arrays, or strings.
wn For any format specifier.
pn For floating-point specifiers only.
en For floating-point specifiers only.
rn For integer specifiers only.
When you use one or more asterisks instead of constants in a source specifier, the arguments
corresponding to the asterisks must appear after the format string in the same order as their
corresponding asterisks appear in the format specifier.
When you use one or more asterisks instead of constants in a target specifier, the arguments
corresponding to the asterisks must precede the target argument and must be in the same order as
their corresponding asterisks in the format specifier.
Scan, ScanFile, ScanIn—Literals in the Format String
Literal characters appearing in a scanning function format string indicate that the literal
characters are expected in the source parameter. They are not stored into any target parameter,
but are skipped over when encountered. If a literal character specified in the format string fails
to appear in the source in the expected position, the scanning function immediately returns.