Hmm... are you generating the dialog box window yourself in the program? If so, why not just have the dialog box's loop check for the $803 (window close) event? Head to Command Ref. --> GUI Events at the B+ startup screen to see a list of all events. If you are using Proceed/Notify/Confirm commands, then why even make a loop for them? They pause the program for you every time they pop up. If you're not doing one of these, then what are you doing? It's just a little bit harder to help if we don't know what you're talking about.