105U-G Wireless Gateway
User Manual
Page 157
© September 2004
scanf
Syntax:
<?--#exec cmd_argument=’scanf( "ObjName", "format", Arg1, ..., ArgN), ErrVal1, ..., ErrvalN’-
->
This SSI function reads a string passed from an object in a HTML form, interprets the
string according to the specification in format, and stores the result in the OUT area
according to the passed arguments. The formatting of the string is equal to the
standard C function call scanf()
ObjName
- The name of the object with the passed data string
format
- Specifies how the passed string shall be formatted
Arg1 - ArgN
- Specifies where to write the data
ErrVal1 -ErrValN
- Optional; specifies the value/string to write in case of an error.
Character
Input data, Argument Type
d
Decimal number; byte, short
i
Number, byte, short. The number may be in octal (leading 0(zero)) or
hexadecimal (leading 0x or 0X)
o
Octal number (with or without leading zero); byte, short
u
Unsigned decimal number; unsigned byte, unsigned short
x
Hexadecimal number (with or without leading 0x or 0X); byte, short
c
Characters; char*. The next input characters (default 1) are placed at the
indicated spot. The normal skip over white space is suppressed; to read the
next non-white space character, use %1s.
s
Character string (not quoted); char*, pointing to an array of characters large
enough for the string and a terminating "\0" that will be added.
e, f, g
Floating-point number with optional sign, optional decimal point and optional
exponent; float*
%
Literal %; no assignment is made.
The conversion characters d, i, o, u and x may be preceded by l (small case L) to
indicate that a pointer to ‘long’ appears in the argument list rather than a ‘byte’ or a
‘short’
The arguments that can be passed to the SSI function scanf are:
Argument
Description
OutWriteByte(
offse
t)
Writes a byte to position
offset
in the OUT area
OutWriteWord(
offse
t)
Writes a word (short) to position
offset
in the OUT area
OutWriteLong(
offse
t)
Writes a long to position
offset
in the OUT area
OutWriteString(
offse
t)
Writes a string to position
offset
in the OUT area
OutWriteFlost(
offse
t)
Writes a floating point (float) value to position
offset
in the OUT
area