home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel
/
CAROUSEL.cdr
/
mactosh
/
lang
/
mod4.hqx
/
M2-4.pit
/
INTERMINAL.DEF
< prev
next >
Wrap
Text File
|
1985-04-25
|
2KB
|
49 lines
DEFINITION MODULE InTerminal;
(* a collection of input routines, and string -> number conversions *)
FROM SYSTEM IMPORT WORD, ADDRESS;
EXPORT QUALIFIED ReadC, ReadI, ReadR, ReadH, ReadAC, ReadAH, ReadCM, ReadAM,
ConvertToC, ConvertToI, ConvertToR, ConvertToH,
ConvertToAC, ConvertToAH,
ConvertToCM, ConvertToAM,
InDone, InEmpty, InEsc, InNoNum, InTooBig;
VAR InDone: BOOLEAN; (* not empty, not ESC, not non-numeric, not too big *)
InEmpty: BOOLEAN; (* why not done: *)
InEsc: BOOLEAN;
InNoNum: BOOLEAN;
InTooBig: BOOLEAN;
PROCEDURE ReadC(VAR c: CARDINAL);
PROCEDURE ReadI(VAR i: INTEGER);
PROCEDURE ReadR(VAR r: REAL);
PROCEDURE ReadH(VAR c: WORD);
PROCEDURE ReadAC(VAR a: ADDRESS);
PROCEDURE ReadAH(VAR a: ADDRESS);
PROCEDURE ReadCM(VAR c: WORD); (* read cardinal in mixed decimal/hex base*)
PROCEDURE ReadAM(VAR c: ADDRESS); (* read address in mixed decimal/hex base*)
(* with a suffix H: base is hexadecimal *)
(* without a suffix H: base is decimal *)
(* note: use ReadAgain to store a digit read in advance *)
(* note: use ReadAgain+ Read(ch) to find the last char read (e.g.ESC) *)
PROCEDURE ConvertToC(VAR s: ARRAY OF CHAR; VAR c: CARDINAL);
PROCEDURE ConvertToI(VAR s: ARRAY OF CHAR; VAR i: INTEGER);
PROCEDURE ConvertToR(VAR s: ARRAY OF CHAR; VAR r: REAL);
PROCEDURE ConvertToH(VAR s: ARRAY OF CHAR; VAR w: WORD);
PROCEDURE ConvertToAC(VAR s: ARRAY OF CHAR; VAR a: ADDRESS);
PROCEDURE ConvertToAH(VAR s: ARRAY OF CHAR; VAR a: ADDRESS);
PROCEDURE ConvertToCM(VAR s: ARRAY OF CHAR; VAR w: WORD); (* convert cardinal mixed *)
PROCEDURE ConvertToAM(VAR s: ARRAY OF CHAR; VAR a: ADDRESS); (* convert address mixed*)
END InTerminal.