home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
lilith
/
m2type.mod
< prev
next >
Wrap
Text File
|
2020-01-01
|
2KB
|
59 lines
IMPLEMENTATION MODULE KermType;
(************************************************************************)
(* Type displays a text file at the screen *)
(* written: 25.02.86 Matthias Aebi *)
(* last modification: 26.02.86 Matthias Aebi *)
(************************************************************************)
FROM M2Kermit IMPORT Param1;
FROM Terminal IMPORT Write, WriteString, WriteLn, Read;
FROM FileSystem IMPORT Lookup, Close, ReadChar, File, Response;
IMPORT KermMisc;
FROM String IMPORT Insert;
(************************************************************************)
PROCEDURE Type;
(************************************************************************)
CONST
ESC = 33C;
VAR
theFile : File;
ch : CHAR;
BEGIN
IF Param1[0] = "?"
THEN
WriteString("Specify the name of the file to be listed");
ELSE
WriteLn;
Insert(Param1, 0, "DK.");
Lookup(theFile, Param1, FALSE);
IF theFile.res # done
THEN
WriteString("Could not open file");
WriteLn;
RETURN;
END;
ReadChar(theFile, ch);
Write(ch);
REPEAT
WHILE (NOT theFile.eof) AND (NOT KermMisc.ReadChar(ch)) DO
ReadChar(theFile, ch);
Write(ch);
END;
IF (NOT theFile.eof) AND (ch # ESC)
THEN (* pause *)
Read(ch); (* wait for character *)
END;
UNTIL theFile.eof OR (ch = ESC);
Close(theFile);
END;
END Type;
END KermType.