For the sake of brevity, I'll be as abstract as I can. If you need more details, I'll be happy to go deeper.
I have developed a medium sized application where I have a flow of 3 main events. 4,300 lines of code and 15 modules (6 are classes) so far. I've tried to make the code modular and reused where appropriate. Each main event is taken care of by several modular pieces of code, which are called by sub-events. Most of them are boolean functions which return a value of true if successful. In some cases this is 3 or 4 levels deep and honestly, it just seems clumsy.
It dawned on me this may be much cleaner if I had a global boolean variable that I just set to false in the event of an error that I didn't' want to proceed with other processes. Does anyone use this type of approach? Or maybe a different approach they prefer?
This isn't about error trapping per se (On Error GoTo, etc.), but stopping events if something upstream didn't work as intended. I look forward to any and all feedback.
I have developed a medium sized application where I have a flow of 3 main events. 4,300 lines of code and 15 modules (6 are classes) so far. I've tried to make the code modular and reused where appropriate. Each main event is taken care of by several modular pieces of code, which are called by sub-events. Most of them are boolean functions which return a value of true if successful. In some cases this is 3 or 4 levels deep and honestly, it just seems clumsy.
It dawned on me this may be much cleaner if I had a global boolean variable that I just set to false in the event of an error that I didn't' want to proceed with other processes. Does anyone use this type of approach? Or maybe a different approach they prefer?
This isn't about error trapping per se (On Error GoTo, etc.), but stopping events if something upstream didn't work as intended. I look forward to any and all feedback.