So I'm trying to make sure that I'm writing non-leaky code, and realized that I don't know how PBDOS 3.5 handles the following:
So the LittleSubs may throw errors, and if they do, I just want to be done with the whole process and dump back to the main code. Does anyone know a) Does the stack get properly unwound in all of that and b) If I have DYNAMIC variables in the LittleSubs, will they get deallocated by that?
Or does this all not work and I should be giving each LittleSub it's own error handler and EXIT FAR?
Code:
SUB MyBigSub ON LOCAL ERROR GOTO Handler CALL LittleSub1 CALL LittleSub2 Handler: SELECT CASE ERRCLEAR CASE 0 CASE ELSE RESUME EndOfSub END SELECT EndOfSub: PRINT "Done" END SUB
Or does this all not work and I should be giving each LittleSub it's own error handler and EXIT FAR?
Comment