Hi Bartok
1. about crashing maybe you can solve adding RESUME NEXT after SLEEP in error procedure
see documentation here https://www.qb64.org/wiki/ON_ERROR
2. about opening files already in use by another program... it depends by locking the file in opening.
It happens often when I want to plug off an USB from PC and some not visible Windows processes are working...
Hi Bartok
I think that RESUME says to the compiler where to jump after the error_manager procedure ends. So without any instruction the situation becomes undefined!
Yes better RESUME just because you put this procedure into a loop and with RESUME NEXT you say to compiler to jump on EXIT DO. While using RESUME you jump at the instruction that activates the error trap.Code: QB64: [Select]
Hi Bartok
I'm not a teacher so my answer is upon my experience...
code is at level 0, error runtime code is at level 1 so also if you have mixed these two levels they are managed in a different way by the compiler.
so your code spaghetti , also if working , can be showed in a more linear mode as following code boxCode: QB64: [Select]
' prima trappola per gli errori runtime /first error trap cancel1: ' seconda trappola per gli errori runtime / second error trap cancel2: Print "Un file interno alla directory" Print "Š aperto in un altro programma." Print "Per proseguire chiudere il file e premere un tasto." Resume inizio ' procedura eliminazione files / killing files procedure inizio: ' fine gestione errori / end managing errors
I hope that this answer gives you a different point of view on runtime error manager