Perhaps you could implement a state machine?
In reply to Re: Complex if/else or case logic by thezip in thread Complex if/else or case logic by cunningrat