Hi brothers and sisters
just some philosophical thoughts about
ON ERROR GOTO && ON ERROR THEN && ON ERROR THEN......END ON ERROR
1. goal of ON ERROR GOTO is clearly managing the exception to the normal (planned) flow of program so the ELSE is still managed by code
A = 0
Line (10, 10)-(100, 100), 14 Print " Press a key to continue" A = A + 1
NextVideoMode:
A = A + 1
Print " Error: Screen mode = "; A
- 1
2. I have seen code with ON ERROR GOTO to manage issues like
File not found,
VideoMode not avaiable indeed illegal funtion call for a graphic statement ,
out of DATA,
Subscritpt Out of Range. For many of these we have specific _QB64 _Keywords to verify to avoid the error on fly.
3. the GOTO /RESUME / RESUME NEXT(Yeah only QB PDS) is an haitful old fashioned structure. But it works!
Yes I would prefer ON ERROR THEN (one line statement without ELSE or END ON ERROR but just the first primitive IF...THEN) to call directly the sub managing the error, so the code to manage can be used also in a recursive way but to get this I must only put the name of SUB just between
ErrorLabel: and
RESUME
'program instructions...
' it makes the right changements
ThisIsAnError:
SolveError
Why don't like multiple lines ON ERROR THEN?
Because in a sub you can put as many as statements and controls you want to have.
So we can do that without developing more keywords.
PS just some mine thoughts. Don't mind