ASK Ask a yes/no question in a pop-up dialog box |
Top Previous Next |
This command not allowed when running as a Windows service or in a locked minimized window.
This script command displays a dialog box with Yes and No buttons. The window title and text within the dialog are specified in the command. Control returns to next script command when you close the dialog by clicking on one of the buttons. This command is useful to ask yes or no questions of an operator during the course of a file transfer session. The ASK command is almost always used in conjunction with either the IFYES or the IFNO command.
If Robo-FTP is running a script in an unlocked minimized window then the Robo-FTP window will be restored when this command is performed.
Consider the following example of a script file that prompts if a file should be sent to an FTP site.
ASK "Send file now?" "Question" IFNO GOTO do_not_send SENDFILE file_name :do_not_send
The dialog looks like the following.
Two embedded formatting or carriage control character sequences are recognized. A \n sequence is interpreted as a carriage return and a \r sequence is interpreted as a line feed. Use of these carriage control sequences permit you to display multiple lines inside a dialog box. For example:
ASK " Line 1 \n\r Line 2 \n\r Question?"
Use of the option /nocrlf suppresses the recognition of the \n and \r sequences. This is useful if you are displaying file names in the message box that may include either of these two sequences. For example:
ASK "Send c:\newfile\reports.dat now?" /nocrlf
The %crlf internal variable may be useful if you need to both format a multi-line message AND need to suppress the \n and \r sequences.
SET long_msg = "Send c:\newfile\reports.dat now?" + %crlf + "I know you want to." ASK long_msg /nocrlf
The [ message ] argument can be quite long -- up to 1000 characters. When using extremely long messages, we suggest that you precede the command with an @ modifier to suppress the echoing of the command to the console window and log file to preserve readability. Use care also not to overflow the possible space in the Windows dialog box that this script command will display by including too many embedded carriage control sequences.
The /large and /local options may not be used together.
Related command(s): IFYES, IFNO, MESSAGEBOX, PROMPT, BROWSE, PLAYSOUND, CONSOLE, CONSOLEMSG, MAILTO See also: Running Robo-FTP With Prompting
|