Download AB7645 User Manual - Support
Transcript
IT Functionality 9-18 Formatted Input scanf 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 Output (OUT) area according to the passed arguments. The formatting of the string is equal to the standard C function call scanf(). Syntax: <?--#exec cmd_argument=’scanf(ObjName, format, Arg1,..., ArgN), ErrVal1,..., ErrvalN’--> ObjName The name of the object with the passed data string format Specifies how the passed string shall be formatted Argn Specifies where to write the data ErrValn Optional; specifies the value/string to write in case of an error. Character Input Data and 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. Table 9-4 scanf Formats © 2013 Pyramid Solutions Inc. Publication PUB-AB7645-010