DEFINITION MODULE Console;
(*******************************************************************
Module Console (Version 1.0)
Copyright (c) 1987-2006 by Alex Itten, Andreas Fischlin and
ETH Zurich.
Purpose Terminal input/output using a cursor and a
scrollable window.
Remarks --
Programming
o Design
Alex Itten 22/05/1987
Andreas Fischlin 14/06/2005
o Implementation
Alex Itten 22/05/1987
Andreas Fischlin 14/06/2005
ETH Zurich
Systems Ecology
CHN E 35.1
Universitaetstrasse 16
8092 Zurich
SWITZERLAND
URLs:
<mailto:RAMSES@env.ethz.ch>
<http://www.sysecol.ethz.ch>
<http://www.sysecol.ethz.ch/SimSoftware/RAMSES>
Last revision of definition: 15/06/2005 AF
*******************************************************************)
FROM DMWindows IMPORT Window;
VAR terminalWindow: Window;
PROCEDURE Read(VAR ch: CHAR);
PROCEDURE BusyRead(VAR ch: CHAR);
PROCEDURE ReadString(VAR s: ARRAY OF CHAR);
(*
Allows editing within line by BS or DEL (rubout), cursor left, right
(within line) and returns as soon as the return key has been pressed.
Note, the return key is not contained in returned s and any keys used
to navigate or edit the string are not contained in s.
*)
PROCEDURE Write(ch: CHAR);
(*
Interpretes BS or DEL (rubout, only within line), cursor left, right
(no rubout, only within line), LF (no return), and CR (carriage
return and line feed)
*)
PROCEDURE WriteString(s: ARRAY OF CHAR);
PROCEDURE WriteLn;
PROCEDURE OpenTerminal;
PROCEDURE SaveTerminal; (* Saves all current visible lines to a file *)
PROCEDURE CloseTerminal;
END Console.