Previous Topic: ? Command--Write Output to stdout (Cmdlet)Next Topic: arrdump Command--Display an Array (Cmdlet)


accept Command--Read String From stdin and Assign it to a Variable (Cmdlet)

Optionally prompts for input, reads characters until an enter is encountered and assigns the character string without the enter to a variable.

The command has the following syntax:

accept [prompt] to var [-hidden]
prompt

(Optional) Specifies a character string to display.

var

Name of variable to assign the string holding the read characters to.

-hidden

(Optional) Masks the input string to enter a password.

Examples

Read a string and assign it to the variable name:

accept "Enter your name: " to name

Mask input to enter a password:

accept "Enter password:" to password -hidden

See also:

wait Command--Wait for a Key Press (Cmdlet)

PW_GET Command--Input Hidden Data (Funclet)