$input » History » Version 10
Per Amundsen, 12/26/2019 11:16 AM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | *$input(prompt,[options],[window],[title],[text])* |
||
4 | |||
5 | Prompts the user for input and returns the result. |
||
6 | |||
7 | 8 | Per Amundsen | _See also [[$yes]], [[$no]], [[$ok]], [[$cancel]], [[$timeout]]._ |
8 | |||
9 | 7 | Per Amundsen | _Can be prefixed with # to ensure the resulted text starts with a channel prefix._ |
10 | |||
11 | 1 | Per Amundsen | *parameters* |
12 | |||
13 | prompt - Question text. |
||
14 | [options] - (optional) |
||
15 | 4 | Per Amundsen | |
16 | 2 | Per Amundsen | e - Show input Editbox. |
17 | p - Show input password Editbox. |
||
18 | o - Show only a OK button. |
||
19 | y - Show Yes/No buttons. |
||
20 | n - Show Yes/No/Cancel buttons. |
||
21 | r - Show Retry/Cancel buttons. |
||
22 | v - Return [[$ok]], [[$yes]], [[$no]], [[$cancel]] for buttons. |
||
23 | g - Right-align buttons. |
||
24 | b - Disables buttons for a second when dialog is displayed. |
||
25 | 9 | Per Amundsen | f - Return [[$no]]/[[$cancel]] for edit/combo boxes if no/cancel is pressed. |
26 | 2 | Per Amundsen | i - Show the information icon. |
27 | q - Show the question icon. |
||
28 | w - Show the warning icon. |
||
29 | 1 | Per Amundsen | h - Show the error icon. |
30 | 9 | Per Amundsen | c - Show the recycle bin icon. |
31 | t - Show the favorites icon. |
||
32 | 2 | Per Amundsen | d - Play the system sound associated with the icon. |
33 | s - Indicates that [window] name has been specified. |
||
34 | 5 | Per Amundsen | a - Unminimize and focus the parent form. |
35 | 1 | Per Amundsen | u - use current active window as parent window |
36 | 2 | Per Amundsen | kN - Close/timeout the dialog after N seconds. On timing out, [[$timeout]] is returned if v is specified, otherwise [[$false]]. |
37 | 6 | Per Amundsen | m - Indicates that multiple text parameters have been specified. They will be displayed in a combobox. |
38 | 1 | Per Amundsen | |
39 | 10 | Per Amundsen | 1 - Show input Editbox (equivalent of the 'e' switch) |
40 | 2 - Show input password Editbox (equivalent of 'p' switch) |
||
41 | 4 - OK button (equivalent of 'o') |
||
42 | 8 - Yes/No buttons ('y') |
||
43 | 16 - Yes/Bo/Cancel buttons ('n') |
||
44 | 32 - Return $ok, $yes, $no, $cancel for buttons. ('v') |
||
45 | 64 - Show the info icon ('i') |
||
46 | 128 - Show the question icon ('q') |
||
47 | 256 - Show the warning icon ('w') |
||
48 | 512 - Show the hand icon ('h') |
||
49 | |||
50 | 2 | Per Amundsen | [window] - Window name to associate the dialog with. |
51 | 1 | Per Amundsen | [title] - The Titlebar text |
52 | [text] - The default text placed in the input Editbox. |
||
53 | |||
54 | *Example* |
||
55 | |||
56 | <pre> |
||
57 | ; Ask for a name and print it. |
||
58 | //echo -ag $input(What is your name?, Question) |
||
59 | </pre> |