Modula-2 || Compiler & Tools || Library || Search Engine
(* diagnostic *) PROCEDURE done () : BOOLEAN; PROCEDURE success() : FmtExitCode;
(* error handling *) PROCEDURE setmode (mode : BITSET); PROCEDURE getmode (VAR mode : BITSET);
(* output *) PROCEDURE printf0 (long : Long; fmt : ARRAY OF CHAR); PROCEDURE printf1 (long : Long; fmt : ARRAY OF CHAR; i1 : ARRAY OF BYTE); PROCEDURE printf2 (long : Long; fmt : ARRAY OF CHAR; i1,i2 : ARRAY OF BYTE); (* ... *) PROCEDURE printf8 (long : Long; fmt : ARRAY OF CHAR; i1, i2, i3, i4, i5, i6, i7 , i8 : ARRAY OF BYTE);
Since the prior contents of long remains uneffected by further calls of printf0 .. printf8 the output can be collected. Allocation and handling of long is in responsibility of the environment using L. LongStrings and OutLines provide the necessary procedures.
done returns TRUE if the last call of printf0 .. printf8 was successful, more detailed information can be obtained by success (FmtExitCode is imported from Printf).
setmode defines a new error handling mode mode which is by default set to Printf.Default. getmode yields the current mode.
[fatal] L.printf1(...,"%h",...); Bad format: illegal conversion character. [a.out] Exit code 205. Stop.
Modula-2 || Compiler & Tools || Library || Search Engine