I had never heard of these techniques before and the docs dont really explain them too well.
Can anyone give a real example of what these would be used for ?
Can anyone give a real example of what these would be used for ?
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
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
Type TXmlReaderException Function Create:TXmlReaderException(ExceptionString:String) Local XmlReaderException:TXmlReaderException=New TXmlReaderException XmlReaderException.ExceptionString=ExceptionString Return XmlReaderException End Function Method toString:String() Return "XmlReaderException: " + ExceptionString End Method Field ExceptionString:String End Type Type TXmlReader Method Read() PartOfReader() End Method Method PartOfReader() AnotherPart() End Method Method AnotherPart() EvenMore() End Method Method EvenMore() SomethingGoesWrongInThisPartOfReading() End Method Method SomethingGoesWrongInThisPartOfReading() Throw TXmlReaderException.Create("Closing Tag not found on line...") End Method End Type Try XmlReader:TXmlReader=New TXmlReader XmlReader.Read() Catch XmlReaderException:TXmlReaderException Print XmlReaderException.toString() End Try