I am delphi programmer as well. In delphi all exceptions derive from Exception so typicall you might write
You notice it is very similar. Now you can just catch o:Object and attempt to figure out what it is if you need general handler
Hope this helps.
Doug Stastny
try .. .. except on e:exception do ... end; [code] MAX isnt much differnt and you can catch different types of exceptions. All exceptions in MAX are objects. You asked how to catch a runtime error :) To catch all exceptions [code] ' Here is one i made up Type EMyException Method ToString:String() Return "EMyException- Poopie" End Method End Type Type TApplication Method Run() Graphics 640,480,0 While Not KeyHit(KEY_ESCAPE) Cls If KeyHit (KEY_F1) RuntimeError "Poop" ' this throws TBlitzException End If If KeyHit (KEY_F2) Throw "Poopie" ' This throws a string object End If If KeyHit (KEY_F3) Throw (New EMyException) ' This throws EMyException End If Flip Wend End Method End Type ' Main code notice the try catch that whats important Try (New TApplication).Run Catch r:TRuntimeException Notify "Runtime "+r.ToString() Catch e:String Notify "Unhandled"+e.ToString() Catch d:EMyException Notify "Unhandled"+d.ToString() End Try
You notice it is very similar. Now you can just catch o:Object and attempt to figure out what it is if you need general handler
Hope this helps.
Doug Stastny