home *** CD-ROM | disk | FTP | other *** search
Modula Definition | 1987-10-18 | 2.3 KB | 84 lines |
- DEFINITION MODULE TermBase;
-
- (* (C) Copyright 1987 Fitted Software Tools. All rights reserved. *)
-
- (*
- The module Terminal does all of its work thru the procedures
- KeyPressed, Read, Write and Goto in this module.
-
- The behaviour of these procedures can be modified by assigning
- new procedures to do the work using AssignRead, AssignWrite and
- AssignGoto.
- *)
-
- TYPE
- StatusProcedure = PROCEDURE() :BOOLEAN;
- ReadProcedure = PROCEDURE( VAR CHAR );
- WriteProcedure = PROCEDURE( CHAR );
- GotoProcedure = PROCEDURE( CARDINAL, CARDINAL );
-
-
- PROCEDURE AssignRead( rp :ReadProcedure; sp :StatusProcedure;
- VAR done :BOOLEAN );
- (*
- save the current Read and KeyPressed procedures in a stack and
- install the new procedures to be used in their place
- *)
-
- PROCEDURE AssignWrite( wp :WriteProcedure;
- VAR done :BOOLEAN );
- (*
- save the current Write procedure in a stack and install
- the new procedure to be used in its place
- *)
-
- PROCEDURE AssignGoto( gp :GotoProcedure; VAR done :BOOLEAN );
- (*
- save the current Goto procedure in a stack and install
- the new procedure to be used in its place
- *)
-
- PROCEDURE UnAssignRead( VAR done :BOOLEAN );
- (*
- pop the Read and KeyPressed procedures saved by InstallRead off
- the stack and make them active again.
- *)
-
- PROCEDURE UnAssignWrite( VAR done :BOOLEAN );
- (*
- pop the Write procedure saved by InstallWrite off the stack and
- make it active again.
- *)
-
- PROCEDURE UnAssignGoto( VAR done :BOOLEAN );
- (*
- pop the Goto procedure saved by InstallGoto off the stack and
- make it active again.
- *)
-
- PROCEDURE KeyPressed() :BOOLEAN;
- (*
- invokes the currently installed KeyPressed procedure.
- During TermBase initialization, TermIO.KeyPressed is installed.
- *)
-
- PROCEDURE Read( VAR ch :CHAR );
- (*
- invokes the currently installed Read procedure.
- During TermBase initialization, TermIO.Read is installed.
- *)
-
- PROCEDURE Write( ch :CHAR );
- (*
- invokes the currently installed Write procedure.
- During TermBase initialization, TermIO.Write is installed.
- *)
-
- PROCEDURE Goto( line, pos :CARDINAL );
- (*
- invokes the currently installed Goto procedure.
- During TermBase initialization, TermIO.Goto is installed.
- *)
-
-
- END TermBase.