mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 09:52:24 +00:00
parent
4a7dc4b549
commit
6a1eccd316
119 changed files with 30400 additions and 0 deletions
34
src/test/testFiles.Mod
Normal file
34
src/test/testFiles.Mod
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
MODULE testFiles;
|
||||
|
||||
IMPORT Files, Texts := CmdlnTexts, Console;
|
||||
|
||||
CONST file="makefile";
|
||||
|
||||
VAR
|
||||
T : Texts.Text;
|
||||
R : Texts.Reader;
|
||||
F : Files.File;
|
||||
ch : CHAR;
|
||||
BEGIN
|
||||
|
||||
F := Files.Old (file);
|
||||
IF F # NIL THEN
|
||||
NEW(T);
|
||||
Texts.Open(T, file);
|
||||
Texts.OpenReader(R, T, 0);
|
||||
Texts.Read (R, ch);
|
||||
|
||||
WHILE ~R.eot DO
|
||||
Texts.Read (R, ch);
|
||||
Console.Char(ch);
|
||||
|
||||
END;
|
||||
|
||||
ELSE
|
||||
|
||||
Console.String ("cannot open"); Console.Ln;
|
||||
|
||||
END;
|
||||
|
||||
|
||||
END testFiles.
|
||||
Loading…
Add table
Add a link
Reference in a new issue