void <prefix>_form(text s, ...);
Outputs the filled out s form.
The form is filled according the formatting directives.
By default, formatting directives are replaced with the next argument in the
arguments list. Some formatting directive classes allow specifying which
arguments should be used. If such an indication is included with the
formatting directive, the indicated argument becomes the current one and the
next one to be used will default to the one following it. The first argument
form corresponds the position 1.
Only arguments of types in a limited set are shown in the output. The types set includes the intrinsic types and the byte data type. Unless otherwise specified, if the type of the processed argument is not in the allowed set no output corresponding the formatting directive occurs.
See The Byte Data Library.
The recognized formatting directives are:
Replaced with the next argument, unless the ‘~’ is followed by a (nonsigned) decimal, case in which the argument in the position corresponding the decimal is used. The arguments are formatted according to their types.
A second sign indicating the replacement follows the ‘%’ sign.
If the sign is one of ‘~’, ‘%’, ‘/’ and ‘)’, the directive is replaced with the sign and no argument is used.
Otherwise, the second sign indicates the output type and a single ‘-’ sign and a (nonsigned) decimal, in this order, may be present between the directive leading and trailing signs. The decimal specifies the minimum number of output characters. White space will be introduced accordingly, before or after the formatted argument if a ‘-’ sign is included with the formatting directive. The recognized output type indications together with corresponding output types are:
decimal (same as ‘%d’)
For the ‘%s’ directive, the type of the corresponding argument is expected one of the intrinsic string type and the byte array type. For the remaining directives, the argument type is expected one of the numeric intrinsic types (cardinal, integer or real).
A second ‘/’ sign follows and marks the end of the formatting directive specification. In between, a (nonsigned) decimal immediately following the leading ‘/’ and a series of formatting modifiers may be present. The decimal indicates the argument to be used, by position. The output modifiers are introduced by lowercase alphabet signs and may allow or take an argument following their lead sign.
No corresponding argument types are implied by the ‘/’ directives, and the formatting modifiers are used only as they apply.
The modifiers allowing a decimal or a positional argument include:
argument indicates the length of the comma separated blocks, applies to integral types only
argument indicates the maximum number of decimal digits, applies the reals only
argument indicates the minimum number of digits, applies to integral types only
argument indicates the minimum number of characters included for the fractional part, applies the reals only. The number is the argument plus one - argument corresponding the number of decimal digits and the one the ‘.’ sign. If less decimal digits are included in the output, white space will introduced accordingly.
argument indicates the minimum number of output characters (white space or the fill character if one indicated will be introduced as required)
argument indicates the output base, applies to integral types only
Decimals modifier arguments appear in the format specification.
Positional modifier arguments are indicated by a ‘~’ sign and they are replaced with the next argument, unless the ‘~’ is followed by a (nonsigned) decimal, case in which the argument in the position corresponding the decimal is used (just like for the ~ formatting directive). The argument is expected a nonnegative integral covertible. If no position was given for the argument to format after the leading ‘/’, the argument after the last interpreted positional modifier argument is formatted. In either case, the next formatting directive starts processing arguments with the one after the formatted argument.
Missing arguments reset modifiers to their respective defaults.
The modifiers always taking an argument include:
sets the fill character for padding to field minimum width
The meaningful modifiers not allowing an argument include:
sets the output type to character, applies to numeric types only
specifies that output is to be escaped for shell use, applies to string types only
specifies that output is to be escaped for characters 0 through 31, ‘"’, ‘\’ and 127 through 255, applies to string types only
specifies that should filling is to be introduced to meet the minimum number of output characters indication, it should be introduced after the formatted argument
specifies the use of upper cases in integral output
Where the formatting directive does not say otherwise, the numeric types are formatted in base 10. The reals are formatted with as many decimal digits as significant.
The output modifiers may appear in the formatting directive any number of times.
|Format and Arguments||Output|
"A ~ B ~ C ~", 1, .5, "TWO"
A 1 B .5 C TWO
"*~3 *~2 *~1", -888, 707z, "eastern"
*eastern *707 *-888
"[%d][%f][%s]", 1001, -.25, "ocean"
"%7d.%-7f.%7s", 1 << 16, 111, "blue"
65536.111 . blue
"// - // - //", 1, 2, 3
1 - 2 - 3
"/f4/ - /x8/ - /w8/", 128, 256, 512
0128 - 400 - 512
"/f4f/ - /x8x2/ - /w8ww6/", 128, 256, 512
128 - 100000000 - 512
"/3b4f16x2/ . /2p6/ . /1s.w8/", "X", -.03125, 511
0000,0001,1111,1111 . -.03125 . .......X
"/f~x~/.%d", 8, 16, 65535, 9.0
"/1s_w~4x~3/.%d", 65535, 9.0, 8, 16