A native Assert function
Posted: Tue Jun 09, 2009 12:11 pm
I really like the idea of having a native Assert function. The signature could look something like this:
The assertion should be tested during compilation (where possible) and during runtime.
If the assertion failes, an error dialog should be displayed showing the exact location in the code,
and maybe some other information followed by an immediate call of the End function.
Would be very handy to develop much more reliable code in Purebasic
Code: Select all
Assert(SizeOf(Integer) = 4)
Assert(OpenWindow(0, ...) <> 0)
Assert(*Ptr <> 0)
If the assertion failes, an error dialog should be displayed showing the exact location in the code,
and maybe some other information followed by an immediate call of the End function.
Would be very handy to develop much more reliable code in Purebasic
