Skip to content

Instantly share code, notes, and snippets.

@deadmarshal
Created January 31, 2024 11:50
Show Gist options
  • Save deadmarshal/eae1a910319492b78d90b4fd2b34301a to your computer and use it in GitHub Desktop.
Save deadmarshal/eae1a910319492b78d90b4fd2b34301a to your computer and use it in GitHub Desktop.
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;
| Thread.Alerted =>
SIO.PutText("Thread.Alerted!\n");
TRY
Wr.Close(wr);
EXCEPT Wr.Failure => SIO.PutText("Failed closing file!\n");
| Thread.Alerted => SIO.PutText("Thread.Alerted!\n");
END;
ELSE
SIO.PutText("ELSE\n");
END;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment