From WikiChip
Editing mirc/identifiers/$input

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 1: Line 1:
 
{{mirc title|$input identifier}}'''$input''' is used to request immediate user-input.
 
{{mirc title|$input identifier}}'''$input''' is used to request immediate user-input.
  
'''Note:''' This replaces the deprecated {{mIRC|$?}} identifier.
+
'''Note:''' This replaces the deprecated '''$?''' identifier.
 +
 
  
 
==Synopsis==
 
==Synopsis==
Line 9: Line 10:
  
 
== Parameters ==
 
== Parameters ==
* '''prompt''' - Parameter must not be blank. Text displayed inside the input dialog window. The input dialog is extended vertically as needed to display the prompt message if it is very long. You can also make text in the prompt message appear on different lines by using {{mIRC|$crlf}} to separate lines. The input window widens as needed by 1-3 buttons, the edit or combo dropdown, icon, or titlebar text
+
* '''prompt''' - text displayed inside the input dialog window. The input dialog is extended vertically to display the prompt message if it is very long. You can also make text in the prompt message appear on different lines by using {{mIRC|$crlf}} to separate lines.
 
* '''options''' - Options can be a combination of the following:
 
* '''options''' - Options can be a combination of the following:
:* e - show input editbox. Content of input editbox returned by clicking leftmost button. Defaults to returning empty string if <esc> out of dialog or pressing 'No' 'Cancel'. Can get $no/$cancel/$timeout by using the forcing 'f switch ('v' switch also required to get $timeout)
+
:* e - show input editbox
:* p - show input password editbox. Same return strings as 'e'
+
:* p - show input password editbox
:* o - 'ok' button
+
:* o - ok button
:* n - 'yes' 'no' 'cancel' buttons
+
:* y - yes no buttons
:* y - 'yes' 'no' buttons
+
:* n - yes no cancel buttons
:* r - 'retry' 'cancel' buttons
+
:* r - retry cancel buttons
:* m - indicates that multiple text parameters have been specified. They will be displayed in a combo dropdown box. The first text item is the default item (a reference to an item in the list), the rest are the items in the list. Selected list item is returned from clicking the leftmost button. Dropdown list begins with the 2nd 'text' parameter, and item from list is displayed as default selection only if it has case-insensitive match with the 1st 'text' parameter.
+
:* v - return $ok, $yes, $no, $cancel for buttons
:* v - Only works when you're not using any of 'pem' switches. makes $input returns $ok, $yes, $no, $cancel, $retry if you press such buttons. Also makes $input returns $timeout if the kN timeout switch is used
 
:* f - This switch is the same as the 'v' switches except it works for when you're using any of the 'pem' switches. Exception: if you're using the kN switch with any of the 'pem' switch, then 'f' must be used in conjunction with 'v' to get $timeout
 
:* kN - an N seconds timeout value. On timing out, has default action of returning $false for 'onyr' switches (or no 'pem' switches used, default) or $null for 'pem' switches. Returns $timeout if 'v' switches is used without 'pem', requires both 'f' and 'v' switches if you're using 'pem' and you want $timeout.
 
 
:* g - right-align buttons
 
:* g - right-align buttons
:* b - disables buttons for 1 second when dialog is displayed and clears keyboard buffer
+
:* b - disables buttons for a second when dialog is displayed
:* tciqwh - show the goldstar,recycle bin,info, question, warning, and halt icons respectively.
+
:* f - return $no/$cancel for edit/combo boxes if no/cancel is pressed
:* d - play system sound associated with icon switch used: 'di' 'dt' = 'asterisk', 'dq' = 'question', 'dw' 'dc' = 'exclamation', 'dh' = 'critical stop'
+
:* iqwh - show the info, question, warning, and halt icons respectively.
:* s - indicates that window parameter has been specified (making optional 'title' be the 4th parameter)
+
:* d - play system sound associated with icon.
:* a - make $input dialog active if mIRC is not the active application
+
:* s - indicates that window name has been specified
:* u - use current active window as parent window, including custom dialog window. In the past, the 's' switch could not be used to pass a custom dialog window as the parent, this switch is then technically there for custom dialog support as parent.
+
:* a - activate dialog
* '''window''' - if option '''s''' is specified, the name of the window to be used as parent window, can be any string that $window(string) will return correctly, so no custom dialog.
+
:* u - use current active window as parent window
 +
:* kN - an N second timeout value. On timing out, $timeout is returned if v is specified, no value if e is specified, and $false otherwise.
 +
:* m - indicates that multiple text parameters have been specified. They will be displayed in a combobox. The first text item is the default item (a reference to an item in the list), the rest are the items in the list.
 +
* '''window''' - if option '''s''' is specified, the name of the window to be used as parent window.
 
* '''title''' - the titlebar text.
 
* '''title''' - the titlebar text.
 
* '''text''' - default text placed in the input editbox
 
* '''text''' - default text placed in the input editbox
  
The options, window, title, and text are optional parameters
+
The options, window, title, and text are optional parameters.
  
By default, 'onyr' switches  return $true from 'Ok' 'Yes' 'Retry' buttons and returns $false from 'No' 'Cancel' buttons. 'pem' switches defaults buttons returning the contents of editbox/combobox except 'No' 'Cancel' buttons returning $null. '''f''' switch extends 'No' 'Cancel' buttons in 'pem' to have same behavior as in 'onyr' with 'v' switch. '''kN''' defaults to returning $false if dialog not exited within N seconds. 'v' changes $true $false from button clicks to instead return '$yes' '$no' '$ok' '$retry' '$cancel', except for $false strings caused by kN change to $timeout.
+
By default, buttons return $true or $null, same as $?. If there is an input editbox, the ok/yes buttons always return the contents of the editbox (unless p switch is used).
  
For the '''options''' parameter, you can also use a number as a combination of value added together, without the presence of any letter switches, which is how $input was originally working:
+
For the '''options''' parameter, you can also use a number as a combination of value added together, which is how $input was originally working:
 
* '''1'''  - show input editbox (equivalent of the 'e' switch)
 
* '''1'''  - show input editbox (equivalent of the 'e' switch)
 
* '''2'''  - show input password editbox (equivalent of 'p' switch)
 
* '''2'''  - show input password editbox (equivalent of 'p' switch)
 
* '''4'''  - ok button (equivalent of 'o')
 
* '''4'''  - ok button (equivalent of 'o')
 
* '''8'''  - yes/no buttons ('y')
 
* '''8'''  - yes/no buttons ('y')
* '''16''' - yes/no/cancel buttons ('n')
+
* '''16''' - yesnocancel buttons ('n')
* '''32''' - return $ok, $yes, $no, $cancel, $retry for buttons. ('v')
+
* '''32''' - return $ok, $yes, $no, $cancel for buttons. ('v')
 
* '''64''' - show the info icon ('i')
 
* '''64''' - show the info icon ('i')
 
* '''128''' - show the question icon ('q')
 
* '''128''' - show the question icon ('q')
 
* '''256''' - show the warning icon ('w')
 
* '''256''' - show the warning icon ('w')
* '''512''' - show the halt icon ('h')
+
* '''512''' - show the hand icon ('h')
* '''1024''' - insert 'window' as the 3rd parameter ('s')
 
* '''2048''' - activate the $input dialog when mIRC is not the active application ('a')
 
* '''4096''' - show the gold star icon ('t')
 
* '''8192''' - retry/cancel buttons ('r')
 
* '''16384''' - align buttons to the right ('g')
 
* '''32768''' - show the recycle bin icon ('c')
 
* '''65536''' - play icon-related sound ('d')
 
* '''131072''' - combo dropdown list ('m')
 
  
 
$input(sup,5) is equivalent to $input(sup,eo)
 
$input(sup,5) is equivalent to $input(sup,eo)
Line 81: Line 74:
 
</source>
 
</source>
 
Pops up an input request asking if the user likes chocolate. If they click '''Yes''', it echoes {{mirc|$true}} to the active window; otherwise, it echoes {{mirc|$false}}.
 
Pops up an input request asking if the user likes chocolate. If they click '''Yes''', it echoes {{mirc|$true}} to the active window; otherwise, it echoes {{mirc|$false}}.
 
== Compatibility ==
 
{{mIRC compatibility|5.9}}
 
 
  
 
== See also ==
 
== See also ==
 
* {{mIRC|$?}}
 
* {{mIRC|$?}}
 +
{{mIRC identifier list}}
 +
 +
[[Category:mIRC identifiers|input]]

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)