Thanks Steve and Eric
I have been running my "Slide Projector Program" now for a number of hours - started at the end of my last reply. It has cycled through 16,010 images (without a hitch) and is still going! Task Manager is oscillating around 77 to 96 Mbyte and over all this time had extremely slowly "creeped" to the 86 to 96 Mbyte range. The images (.jpg) typically ranged in size from 10 KB to ~ 200KB.
I inserted Steve's "handle <-1 etc check".
Before I started this topic, my Slide Projector Program resulted in the need for the following code fragments :-
ON ERROR GOTO Errhandler ' ********************************************
~~~~~~~~~
eror_258% = 0 ' reset error # 258 flag
GOSUB PUT_image
~~~~~~~~~
Errhandler:
eror% = -1
SELECT CASE ERR
CASE 258: eror_258% = -1 ' _Putimage invalid handle
CASE 5::: eror_005% = -1: ' ' _FreeImage illegal function call
CASE ELSE: BEEP: BEEP: BEEP
END SELECT
RESUME NEXT ' moves program to code following the error
RETURN
PUT_image:
img& = _LOADIMAGE(img$)
_PUTIMAGE (x0%, y0%)-(x1%, y1%), img& ' 512x512 image TRHC
IF img& < -1 THEN _FREEIMAGE img&: img& = 0' Steve's suggestion inserted here
StopWatch& = TIMER
IF NOT (eror_258%) THEN
StopWatchSET& = TIMER
END IF
IF (StopWatch& - StopWatchSET&) > StopWatchMax& THEN GOTO BEEPsystemEND ' just BEEP : SYSTEM: END
RETURN
The SYSTEM command may not be needed.
The Stopwatch code was handy for automatic shutdown. In my case the timeout was preset to 3 minutes since last VALID image.
The handle (img& <-1) etc as suggested by Steve was inserted.
ERROR #258 frequently occurred with my very old images - say roughly 1% were well and truly corrupted which neither _PUTIMAGE or windows PAINT, etc could do anything with - and say roughly 1% _PUTIMAGE cannot (as the program was written) do anything BUT are viewable in Windows PAINT, PHOTOS, and just about any other commercial viewer app CAN display - the remaining 98% were well behaved.
Many thanks.
By the way Eric - where does one insert the USB memory stick on the IBM and more importantly where is the display?
For those curious to know - Slide projector program (1st run) STILL RUNNING - 37,038 images (1.40 GB) processed, time elapsed ~ 14.5 hours (if my time calculations are correct), Task Manager oscillating 85 - 88 MB (ocassionally up to 95 MB) and no trending now easily visible --- program did not timeout or anything --- PROGRAM STILL CONTINUOUSLY RUNNING without intervention.
For those curious to know - Slide Projector Program (1st run) - 58,241 images (2.15 GB) processed, time elapsed ~23 hours, Task Manager 84-89 MB oscillating (final value 84.2) no observable trend --- PROGRAM terminated by me.
No more updates!