4.6.6.3 Formatted Output

format(Control, Arguments) interprets the Arguments according to the Control string and prints the result on the current output stream. Alternatively, an output stream can be specified in a third argument. This predicate is used to produce formatted output, like the following example.

     | ?- toc(1.5).
     Table of Contents                                               i
     ************************ NICE TABLE *************************
     *                                                           *
     *      Right aligned      Centered      Left aligned        *
     *                123         45         678                 *
     *                  1        2345        6789                *
     *************************************************************

For details, including the code to produce this example, see the example program in the reference page for format/[2,3].


Send feedback on this subject.