12-17-2023, 10:05 PM
And knowing that, you might want to change your code to:
Code: (Select All)
SUB RemoveImage (Image AS LONG)
IF Image < -1 THEN ' does an image exist?
_FREEIMAGE Image ' yes, remove the image from RAM
Image = -1 ' reset the associated image variable, but don't use 0 as it's a valid handle in many cases
END IF
END SUB