Code archives/Miscellaneous/Verify LoadImage() and LoadAnimImage()

This code has been declared by its author to be Public Domain code.

Download source code

Verify LoadImage() and LoadAnimImage() by Glitch01
(Posted 25 years ago)
Use these two function in place of the standard LoadImage() and LoadAnimImage().

If the image requested does not exists, an error message will inform the user which image is missing. This is much nicer thn the "exception" error messages and much cleaner than coding a check for every image used.

Feel free to send any comments my way!

-Steve
;-------------------------------------------------;
; vLoadImage
;
;-------------------------------------------------
Function vLoadImage(file$)

	pointer = LoadImage(file$)
	
	If Not pointer Then
		RuntimeError ("Error loading file [" + file$ + "].")
		End
	Else
		Return pointer
	EndIf
		
End Function


;-------------------------------------------------;
; vLoadAnimImage
;
;-------------------------------------------------
Function vLoadAnimImage(file$,CellWidth,CellHeight,FirstCell,CellCount)

	pointer = LoadAnimImage(file$,CellWidth,CellHeight,FirstCell,CellCount)
	
	If Not pointer Then
		RuntimeError ("Error loading file [" + file$ + "].")
		End
	Else
		Return pointer
	EndIf
		
End Function