PROMPT Display a text message 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 on your display. 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 the OK or Cancel buttons. This command is useful to prompt for file names or other information that is not static during the course of a file transfer session.
If Robo-FTP is running a script in a unlocked minimized window then Robo-FTP window will be restored when this command is performed.
The script file can detect if the Cancel button has been clicked by using IFERROR to test for result code 1013 or the $ERROR variable $ERROR_PROMPT_CANCELLED.
Consider the following example of a script file that prompts you for the name of next file to send to an FTP site.
PROMPT file_name "Enter File name:" "Prompt Window" IFERROR= $ERROR_PROMPT_CANCELLED GOTO done SENDFILE file_name :done
The prompt dialog looks like the following:
Up to three lines of text may be displayed as a prompt. Use \n and/or \r carriage control characters to format the text display. Any \n characters after the two are discarded.
The /nocrlf option 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:
PROMPT new_name "Enter new name for file c:\newfile\reports.dat" "Rename File" /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 = "Enter new name for file c:\newfile\reports.dat" + %crlf + "Make it good!" PROMPT new_name long_msg "Rename File" /nocrlf IFERROR= $ERROR_PROMPT_CANCELLED GOTO next_step RENAME "c:\newfile\reports.dat" new_name :next_step
The /large and /local options may not be used together.
Related Commands: MESSAGEBOX, ASK, BROWSE, PLAYSOUND, CONSOLE, CONSOLEMSG See also: Running Robo-FTP With Prompting
|