Chapter 2 Formatting and I/O Library
© National Instruments Corporation 2-39 LabWindows/CVI Standard Libraries
tn Terminate on Character. When applied to a source string, the t string modifier
specifies that the source string is terminated on the first occurrence of the character
n
,
where
n
is the ASCII value of the character. Thus, %s[t44] causes reading of the
source string to stop on an ASCII comma. Using %s[t44] and the source string
Hello, World! as an example, Hello is placed into the target. More than one
t modifier can occur in the same specifier, in which case the string terminates when
any of the terminators occur. If no t modifier is present, reading of the source string
stops on an ASCII NUL. This modifier has no effect when applied to the target
specifier.
t- Terminate when Full. This is similar to t
n
, except that it specifies that there are no
terminating characters. Reading of the source string terminates when the target is full
or when the number of bytes specified with the w modifier have been read.
t# Terminate on Number. This is equivalent to repeating the t modifier with the
ASCII values of the characters +, -, and 0 through 9. It specifies that reading of the
source string be terminated upon occurrence of a numeric expression. Using %s[t#]
with the source string ab567, ab is placed in the target.
Fmt, FmtFile, FmtOut—Asterisks (*) Instead of Constants in Format Specifiers
Often, one or more integer values are required in a format specifier. 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.
You can 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 target 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 source specifier, the arguments
corresponding to the asterisks must precede the source argument and must be in the same order
as their corresponding asterisks in the format specifier.