$?

From Scriptwiki
Revision as of 13:42, 10 May 2008 by Daveoh (talk | contribs)

Jump to: navigation, search

Prompts the user for input and returns the result.

$?*!="message"

Examples

//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 $?1="Please enter a value."

In this case the input dialog will only show if $1 is $null. If $1 exists, it will be used in place.

//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 /scon or a /timer to initiate an input request after the script ends.