Console.AskYesNo() Method
Asks a yes/no question using the input field. Returns the answer as True/False.
Syntax
Console.AskYesNo(Prompt, [WebTimeout])
The method syntax has these parts:
Part |
Description |
Prompt (String) |
string containing a yes/no question to ask |
WebTimeout (Long) |
Timeout for the web virtual console (seconds, default 300) See note below |
Return (Boolean) |
True if the Yes button was pushed, False if the No button was pushed. |
Remarks
The user must press either yes or no, there is no way to cancel. For the web virtual console, a second optional parameter WebTimeout may be supplied. See below.
This method will raise an error after 300 seconds if the request comes from the web and the user does not respond within this interval. The timeout can be modified by including the optional WebTimeout parameter in the call.
WebTimeout Notes
- The value is in seconds, and affects only the web virtual console.
- If the value is positive, the method will raise an error if the timeout elapses with no user input.
- If the value is 0, no timeout will occur, allowing the script to hang forever or until aborted (at which time the method will raise an error).
- If the value is negative, no error will be raised if the timeout elapses. Instead, the script will continue normally and the returned result will be consNo.
Copyright © 2000-2016, Robert B. Denny, Mesa, AZ