home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 18
/
aminetcdnumber181997.iso
/
Aminet
/
dev
/
m2
/
CycloneModules.lha
/
modules
/
txt
/
Terminal.def
< prev
next >
Wrap
Text File
|
1995-04-13
|
2KB
|
79 lines
DEFINITION MODULE Terminal;
(* (C) Copyright 1993 Marcel Timmermans. All rights reserved. *)
FROM SYSTEM IMPORT WORD;
PROCEDURE Read( VAR ch :CHAR );
(*
read a character
*)
PROCEDURE ReadString( VAR s :ARRAY OF CHAR );
(*
read a string.
input is terminated by a ' ', or any control character except BS or DEL.
the terminating character is saved in termCH.
when reading from the terminal, editing of the input is available:
ASCII.BS deletes the last characted input
ASCII.DEL deletes all characters input
ASCII.ESC deletes all characters input and returns
*)
PROCEDURE ReadInt( VAR x :INTEGER );
(*
a string is read from the input device and is then converted to
an INTEGER.
*)
PROCEDURE Write( ch :CHAR );
(*
write the character
*)
PROCEDURE WriteLn;
(*
same as: Write( ASCII.EOL )
*)
PROCEDURE WriteString( s :ARRAY OF CHAR );
(*
write the string out
*)
PROCEDURE WriteLine( s :ARRAY OF CHAR );
(*
same as: WriteString( s ); WriteLn;
*)
PROCEDURE WriteInt( x :LONGINT; n :CARDINAL );
(*
write the INTEGER right justified in a field of at least n characters.
*)
PROCEDURE WriteCard( x : LONGCARD; n : CARDINAL);
(*
write the CARDINAL right justified in a field of at least n characters.
*)
PROCEDURE WriteOct( x, n :CARDINAL );
(*
write x in octal format in a right justified field of at least n characters.
IF (n <= 3) AND (x < 100H) THEN 3 digits are written
ELSE 6 digits are written
*)
PROCEDURE WriteHex( x :LONGINT; n :CARDINAL );
(*
write x in hexadecimal in a right justified field of at least n characters.
IF (n <= 2) AND (x < 100H) THEN 2 digits are written
ELSE 4 digits are written
*)
PROCEDURE ReadLongInt( VAR x :LONGINT );
(*
a string is read from the input device and is then converted to
a LONGINT.
*)
END Terminal.