PDA

View Full Version : On Error always crash?



ReneMiner
14-11-2012, 22:12
I'm writing some mesh-editor, this time uses textures, now I got a problem:

User is allowed to browse his drives to load textures or models. But if user decides to choose an unsupported file (maybe compressed *.tga or else), script-execution stops and throws error. Same if try to load sprites or corrupted meshes.
I can't find anything about Error-Handling except Err/ErrClear and that is useless since script already stopped.

How can I prevent thinBasic from stopping script-execution in these cases?
couldn't methods just return False if doesn't load instead of stopping execution?

cannot continue coding until problem is solved :(

Petr Schreiber
15-11-2012, 10:00
Hi Rene,

you can change this behavior using the TBGL_ErrorMessages statement, please see help for further explanations.


Petr

ReneMiner
15-11-2012, 11:16
OK, for textures is now a way to find out about successful loading by testing for TBGL_GetTextureName(index), m15 i can TBGL_m15GetModelVertexcount and sprites has already a TBGL_SpriteExists()-method

...hmmm... :?

I copied part of an older of my posts about that to support-section so it doesn't get lost:

http://www.thinbasic.com/community/project.php?issueid=370