Error control when loading files ..

Blitz3D Forums/Blitz3D Beginners Area/Error control when loading files ..

Hansie(Posted 2003) [#1]
hey ...

is it just me or can it be true that neither BlitzPlus not Blitz3D has any return value when loading an image or file? what is the file does not exist? for example - loadimage(), doesnt that command return any error condition that can be checked and evaluated?????


soja(Posted 2003) [#2]
Sure, it returns 0 if it was unsuccessful.


Hansie(Posted 2003) [#3]
Soja, Thanks!

In fact - I submitted this "a tad too quick" :-D the official docs does not mention it, but sample code does !


(tu) sinu(Posted 2003) [#4]
pic = loadimage("picture.bmp")
If pic = 0
RuntimeError "picture.bmp missing from models folder"
EndIf


Hansie(Posted 2003) [#5]
Thanx