RosettaCodeData/Task/Assertions/XPL0/assertions.xpl0

11 lines
427 B
Plaintext

proc Fatal(Str); \Display error message and terminate program
char Str;
[\return; uncomment this if "assertions" are to be disabled
SetVid(3); \set normal text display if program uses graphics
Text(0, Str); \display error message
ChOut(0, 7); \sound the bell
exit 1; \terminate the program; pass optional error code to DOS
];
if X#42 then Fatal("X#42");