If a script requires input while it is running, use one of the following commands:
Waits for a key press and optionally stores the typed character in a variable.
Reads a string from the keyboard (stdin) until enter is pressed:
Examples
Wait until an arbitrary key has been pressed:
wait "Press any key…"
Wait until one key has been pressed and store the resulting character in the variable ch.
wait ""Press any key" to ch
Read a string until an enter is encountered and store it to the variable str.
accept to str
Display the prompt message "Enter amount: ", read the input string until an enter is encountered, and store it to the variable str.
accept "Enter amount: " to str
Copyright © 2013 CA. All rights reserved. |
|