The format in which output is printed may be specified in various ways,
which broadly divide into two classes: those that find a format suitable
for the argument, and those that map the argument to fit the format.
The first class is used by routine
type and its aliases, as well
str. The second class is
Input routines are similarly divided into two classes. Routines
readf read data depending on the argument type,
freads read data
according to a specified format.
To do any kind of formatted input or output, one must be able to specify the format that is to be used. LUX uses format specifications which are modeled on those from C, but with some modifications.
Format strings consist of ordinary text, format entries, and format groupings. All format entries are introduced by a percent sign (%) and must contain a specifier character (which indicates the type of data the format applies to). The simplest formats contain nothing more.
A general single format entry consists of the following components, in the indicated order:
See also: fprint, fprintf, fread, freadf, freads, fstring, printf, read, readf, str, string, type.
|• Format Specifiers:|
|• Format Modifiers:|
|• Format Field Width:|
|• Format Precision:|
|• Format Grouping:|
|• Long output lines:|
|• In-Line Print Formats:|
|• Output Data Formats:|
|• Input Data Formats:|