WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: geauga on September 01, 2016, 07:28:53 AM

Title: Prompting User For Input
Post by: geauga on September 01, 2016, 07:28:53 AM
I am looking for a function similar to AskYesNo but that has a timeout.  Right now I have a utility that user run that does a bunch of stuff.  One of the items potentially takes a long time.  I want to prompt the user to find out whether they want to bypass the long step.  While this is simple enough I want there to be a timeout so that if they ignore the prompt that my program continues on using some default parameters.  Essentially I am asking for a AskYesNo with a timeout similar to Display.  Any suggestions?
Title: Re: Prompting User For Input
Post by: td on September 01, 2016, 08:17:51 AM
There are several ways to do this but a WIL dialog might be the cleanest solution.  Create an a WIL dialog with the appropriate prompt and a user-defined-callback for the dialog.  Setup a timer event in the dialog callback.  When the timer has elapsed and the timer event fires simple have the callback exit with the appropriate return value (@retCancel or a positive intenger) that causes the dialog to terminate. 
Title: Re: Prompting User For Input
Post by: stanl on September 01, 2016, 02:06:34 PM
Since you alluded to several parameters/settings for the routine, you might also consider a pop-up dialog with checkboxes (default checked) and let the user decide to uncheck before the routine actually runs - this way you could log what was skipped. Otherwise Tony's idea is simple and clean.