Exception handling.
essentially it is in the format of:
try > throw > catch > end try
the try / end try block is also referred to as an Exception Block, you are trying to isolate a behavior
throw forwards a caught exception
catch handles the exception:
here is another example that is a little more useful:
Try Repeat a:+1 DrawText (a+"is OK",400,300) If a>5 Throw "chunks" Flip Cls Delay 100 Forever Catch a$ cls DrawText ("caught exception "+a$,400,300) flip waitmouse EndTry
essentially it is in the format of:
try > throw > catch > end try
the try / end try block is also referred to as an Exception Block, you are trying to isolate a behavior
throw forwards a caught exception
catch handles the exception:
here is another example that is a little more useful:
Rem Throw generates a BlitzMax exception. End Rem Graphics 800,600,0 Local bmax:String[]=["one","two","three","four"] Try Repeat a:+1 DrawText (bmax[a],400,300) If a > 4 Then Throw "BAM!" Flip Cls Delay 300 Forever Catch ex:Object cls DrawText (ex.Tostring() ,10,300) flip waitmouse EndTry