(* Advances the "read pointer" by one character *)
PROCEDURE Eoln(InputText: Text): BOOLEAN;
- (* Returns TRUE if the next character of the InputText is a linefeed *)
+ (* Returns TRUE if the next character of the InputText is a linefeed.
+ Unlike Pascal however, it does not produce a runtime error when
+ called when Eof(InputText) is TRUE.
+ *)
PROCEDURE Eof(InputText: Text): BOOLEAN;
(* Returns TRUE if the end of the InputText is reached *)
PROCEDURE ReadChar(InputText: Text; VAR Char: CHAR);
- (* Read a character from the InputText, and leave result in "Char" *)
+ (* Read a character from the InputText, and leave result in "Char".
+ Unlike Pascal, if Eoln(InputText) is true, the newline character
+ is put in "Char".
+ *)
PROCEDURE ReadLn(InputText: Text);
(* Skip the rest of the current line of the InputText,
PROCEDURE ReadCardinal(InputText: Text; VAR Cardinal: CARDINAL);
(* Skip leading blanks, read a cardinal from the InputText, and leave the
- result in "card".
+ result in "Cardinal".
If no cardinal is read, or when overflow occurs, a runtime error results.
- Input stops at the character following the integer.
+ Input stops at the character following the cardinal.
*)
PROCEDURE ReadReal(InputText: Text; VAR Real: REAL);
[ E [(+|-)] digit {digit} ]
If no real is read, or when overflow/underflow occurs, a runtime error
results.
- Input stops at the character following the integer.
+ Input stops at the character following the real.
*)
(***************************************************************************
PROCEDURE WriteBoolean(OutputText: Text; Boolean: BOOLEAN; Width: CARDINAL);
(* Write boolean "Boolean" to the OutputText, using at least "Width" places,
blank-padding to the left if needed.
- Equivalent to WriteString(" TRUE", Width), or
- WriteString("FALSE", Width)
+ Equivalent to WriteString(OutputText, " TRUE", Width), or
+ WriteString(OutputText, "FALSE", Width)
*)
PROCEDURE WriteString(OutputText: Text;