One of the problems I've always had (and I'm running into it again) is how to terminate a program based on an error. Basically, in a piece of code (foreign to Application.Terminate because all my searches are leading there, this code knows nothing of TApplication and shouldn't), I run into a condition that requires the program cease. How do I do that?
I've tried everything I can think of after that raise line and the program merrily goes on its way and runs as if everything is alright.
So how do I kill this program when it produces this error?
Code:
if (problem condition that borks the program if the code continues) then
begin
raise Exception.Create('There's a problem that will bork the program if this continues.');
(Kill the program here, basically I'm wanting to produce a crash condition)
end;
I've tried everything I can think of after that raise line and the program merrily goes on its way and runs as if everything is alright.
So how do I kill this program when it produces this error?