Some VID script functions make use of fprmat strings.
These gunctions include, print(), syslog() and com().
A format string parameter contains zero or more of the following conversion specifications,
parameters folowing the format string are the data for the conversions to act open,
each conversion in the format string must have a matching parameter.
| % | A conversion specification is introduced with this required character. |
| flags | followed by zero or more flags |
| width | followed by an optional width field |
| precision | followed by an optional precision field |
| conversion | ending in a required conversion type character |
Will print the variable "val" as a Hexadecimal number within a field width of four charactes padded with leading zeroes if required, followed by the same number represented as a decimal number in a 6 character field, padded, if required, by spaces.
Flags
These are used to change the default behavior of the conversion.
| - | left justify the field |
| 0 | pad number conversions with leading zeros, ignore if a - is present |
| space | pad number conversions with leading space, ignore if a - is present |
Field Width
The number of characters wide a field is.
Spaces (or zeroes) are used to pad the extra characters if a value is not as wide as
the given width. If the value is larger than this number, the field will expand to fit the number.
Precision
The minimum number of digits to appear for integer types
or the number of digits to apear after a floating point number
or the maximum number of characters to print from a string.
This takes the form of a decimal point followed by an optional number.
If no number is given the precision defaults to 0.
Conversions
| d | print int to signed decimal |
| i | print int to signed decimal |
| o | print unsigned int to unsigned octal |
| u | print unsigned int to decimal |
| x | print unsigned int to hexidecimal (lowercase) |
| X | print unsigned int to hexidecimal (uppercase) |
| f | print double to decimal |
| e | print double to scientific notation (lowercase 'e') |
| E | print double to scientific notation (uppercase 'E') |
| s | print string pointer to string |
| c | print int (ASCII value) as a single character |
| % | print a single % in the output by escaping as %% |