[Complex] How to raise and catch an exception...
Posted on 2004-10-18
And if you answer "use raise exception.create('Blabla'); then you won't deserve any points! :-P
Okay, situation. I have a very simple application written in Delphi 7 of about 25 KB in size. But the single method it contains might cause an error and I want to raise an exception that I can capture in the except-part of a try-except block.
Now, if I include the SysUtils unit then the problem is easily solved. But hey, guess what? I DON'T want to use the SysUtils unit. It adds almost 20 KB of additional binary data to my executable which is about 20 KB too much in my opinion. I don't want to explain why my simple toll suddenly doubles in size. So how to raise and catch exceptions WITHOUT using any unit except for the Windows unit.
So, NO OTHER UNITS! Raw API stuff. :-)