If I set to 100 then I get an Unhandled Memory Exception as the array is only declared for 100 (e.g. 0 to 99).
If I press 'esc' quickly then I get the delay but, my guess, is it is still in the image loading loop. If I wait for 10-15 secs to ensure the load has ended to seems to esc immediately.
<edit> Sorry if I have missed something. I added
and whenever I hit 'esc' I always see 'done' printed as it can only end once out of the loop. (e.g. the 'ESC' key is buffered for reading after the loop.
<EDIT> You might also want to make your example code a bit simpler.
If I press 'esc' quickly then I get the delay but, my guess, is it is still in the image loading loop. If I wait for 10-15 secs to ensure the load has ended to seems to esc immediately.
<edit> Sorry if I have missed something. I added
For Loop = 1 To 99 IMG_Dust[Loop] = LoadImage("background.png") Print "doing" Next Print "Done"
and whenever I hit 'esc' I always see 'done' printed as it can only end once out of the loop. (e.g. the 'ESC' key is buffered for reading after the loop.
<EDIT> You might also want to make your example code a bit simpler.