Skip to content

Instantly share code, notes, and snippets.

View deadmarshal's full-sized avatar
🏠
Working from home

Ali deadmarshal

🏠
Working from home
View GitHub Profile
TRY
wr := IO.OpenWrite("output.txt");
EXCEPT
| Wr.Failure =>
SIO.PutText("Failed opening file to write!\n");
TRY
Wr.Close(wr);
EXCEPT Wr.Failure => SIO.PutText("Failed closing file!\n");
| Thread.Alerted => SIO.PutText("Thread.Alerted!\n");
END;
MODULE BasicTypes EXPORTS Main;
IMPORT IO;
PROCEDURE RepeatChar(READONLY C:CHAR;READONLY Start,End:CARDINAL) =
BEGIN
FOR I := Start TO End DO IO.PutChar(C) END;
IO.Put("\n")
END RepeatChar;