105U-G Wireless Gateway
User Manual
Page 155
© September 2004
n
- Specifies maximum number of characters to read (Optional)
printf
Syntax:
<?--#exec cmd_argument=’printf("String to write", Arg1, Arg2, ..., ArgN)’-->
This SSI function includes a formatted string, which may contain data from the
Fieldbus IN/OUT area, on a web page. The formatting of the string is equal to the
standard C function printf().
Like the standard C function printf() the "String to write" for this SSI function
contains two types of objects: Ordinary characters, which are copied to the output
stream, and conversion specifications, each of which causes conversion and printing
of the next successive argument to printf. Each conversion specification begins with
the character % and ends with a conversion character. Between the % and the
conversion character there may be, in order:
•
Flags (in any order), which modify the specification:
-
which specifies left adjustment of the converted argument in its field.
+ which specifies that the number will always be printed with a sign (space) if
the first character is not a sign, a space will be prefixed.
0
for numeric conversions, specifies padding to the field with leading zeroes.
# which specifies an alternate output form. For o, the first digit will be zero. For
x or X, 0x or 0X will be prefixed to a non-zero result. For e, E,f, g and G, the
output will always have a decimal point; for g and G, trailing zeros will not be
removed.
•
A number specifying a minimum field width. The converted argument will be
printed in a field at least this wide, and wider if necessary. If the converted
argument has fewer characters than the field width it will be padded on the left (or
right, if left adjustment has been requested) to make up the field width. The
padding character is normally space, but can be 0 if the zero padding flag is
present.
•
A period, which separates the field width from the precision.
•
A number, the precision, that specifies the maximum number of characters to be
printed from a string, or the number of digits to be printed after the decimal point
for e, E, or F conversions, or the number of significant digits for g or G
conversion, or the minimum number of digits to be printed for an integer (leading
0s will be added to make up the necessary width)
•
A length modifier h, l, or L. "h" Indicates that the corresponding argument is to be
printed as a short or unsigned short; "l" or “L” indicates a long or unsigned long.