08-17-2024, 03:08 AM
(08-17-2024, 02:17 AM)Pete Wrote: Terry,Yep, sure is. But in the other thread RhoSigma made a good point about how using ON ERROR the way I am will not preserve any previous ON ERROR label that may have existed. It looks like I'll need to remove the .BI file and ON ERROR statement completely any way.
Since you are error trapping, isn't this line redundant?
IF i > -2 THEN EXIT FUNCTION
Pete
As I said in the other thread, what is really needed is a way to verify that image handles are valid.
_VALIDIMAGE(Handle&)
or something similar. Image handles can't exist above -2 but there is no way to check if a number within the valid handle range actually contains an image. This would be useful for another reason too. When you free an image (_FREEIMAGE) any associated variable that contains the handle value still retains that value. I've made it a habit after freeing an image to also set any associated variable to -1.
_FREEIMAGE(MySprite&)
MySprite& = -1
This way checks for -2 or less will catch this as an invalid image handle since it was previously removed.