|
control flow in nested loops
(I put this into this fourm as it is pretty much relevant to most languages.)
I am using VB6
and have a IF loop.
If scannedDataCorrect Then
..do something
..ClFrmSub
Else
..Error
now my ClFrmSub subroutine is supposed to clear scan field, then return focus to it.
the problem is that of cxourse as the field is cleared, it no longer contains the correct data and when the sub routine returns program flow drops into the "Else" and I get the error message
I dont think there is a way that the subroutine could break out of the IF while retaining control itself so that it can return to the next bit of the program.
Maybe Im missing something, but I think all conditional "switchs" or "loops" must return to their end instruction to properly run.
Is this true for all cases?
__________________
|