$?

From Scriptwiki
Revision as of 11:01, 2 July 2007 by Cail (talk | contribs) (added category)

Jump to: navigation, search

$?*!="message"

Prompts the user for input and returns the result.

//echo $?="What is your name?"
If the user enters their name in the editbox and presses the OK button, $? will return whatever the user entered. If the user clicks on the Cancel button, $? returns nothing.

//echo $?*="What is your password?"
In this case the $?* makes any text that the user types into the editbox appear as ***** characters to prevent anyone seeing what is being entered.

//echo $?!="Shall I continue?"
In this case, a Yes/No dialog pops up. If the user clicks on Yes, $true is returned, otherwise $false is returned.

The input dialog is extended vertically to display the whole message if it is very long. You can also make text appear on different lines by using the $crlf identifier to separate the lines, eg.

//echo $?="This is on the first line. $crlf $+ And this is on the 2nd line."

Note: This identifier cannot be used in a script event. One way around this is to use a /timer to initiate an input request after the script ends.