Error checking

Blitz3D Forums/Blitz3D Programming/Error checking

big10p(Posted 2004) [#1]
Hi.

I was just wondering how much error checking people put in their code, specifically those of you who have released commercial products.

I mean, do you check that a valid handle is returned every time you create a new type/bank/image etc.? Or do you just check when loading media and the like?


JazzieB(Posted 2004) [#2]
Well, I personally only check that all media has loaded correctly. When sound files don't load I assume that the user doesn't have a sound card (the old see if a WAV file loads to determine the presence of a sound card trick) and then simply don't attempt to play any sounds or music in the rest of the game.

I don't bother when creating Types, Banks or Images within the program - I assume they have always been created without a hitch. Not had any problems so far.

Maybe others will say different, although I do try and test any release on as many systems as possible.

I also check every possible outcome of If..Then, etc, conditions to ensure that the program reacts as it should - often forcing outcomes by setting variables at the relevant places to be sure.


big10p(Posted 2004) [#3]
OK, thanks JazzieB. ;)

TBH, it didn't even occur to me that I might need to check to see if a soundcard exists. :/

Anybody else with info? I think this is useful knowledge for everyone. C'mon all you famous, published people - let us know what/how you do error checking. :)


stanrol(Posted 2010) [#4]
Not all B3D funcs. return err. codes to check. I like return codes and use it often. No published title yet.