Category : Modula II Source Code
Archive   : M2CMP20.ZIP
Filename : TERMBASE.DEF

 
Output of file : TERMBASE.DEF contained in archive : M2CMP20.ZIP
DEFINITION MODULE TermBase;

(* (C) Copyright 1987,1988 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.

  3 Responses to “Category : Modula II Source Code
Archive   : M2CMP20.ZIP
Filename : TERMBASE.DEF

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/