Autoit inputbox Function

Source: Internet
Author: User

Function Description

Inputbox

An input box is displayed for users to enter data. Inputbox ("title", "prompt information" [, "default data" [, "Password character" [, width, height [, left, top [, time-out period])

Parameters

title the title text in the input box.
message the system prompts the user to Program the data to be obtained.
default data default text displayed in the input text box.
Password character [optional parameter] characters used to replace user input characters are displayed in the input text box. To properly display characters, you only need to define this parameter as an empty string "" (default) or space character. If this parameter is set to a multi-character string, only the first character is valid. The second character and other subsequent characters have other special purposes. See the following notes.
width [optional parameter] window width. If this parameter is specified, the height parameter must also be specified. If-1 is specified, the default width is used.
height [optional parameter] window height. If this parameter is specified, the width parameter must also be specified. If-1 is specified, the default height is used.
left [optional parameter] The distance (in pixels) from the left of the input box to the left of the screen ). By default, the input box is centered. If this parameter is specified, the preceding parameter must be specified.
above [optional parameter] The distance (in pixels) from the top of the input box to the left of the screen ). By default, the input box is centered. If this parameter is specified, the left parameter must be specified.
timeout [optional parameter] in seconds. The input box is automatically closed after the specified time.

Return Value

Successful: Returns the string entered by the user.
Failed: Return an empty string and set @ error to one of the following values:
@ Error 0 = the returned string is valid.
1 = the user presses the cancel (cancel) button.
2 = timeout.
3 = an error is displayed in the input box, which is usually caused by Invalid parameters.

Note:

Use blockinput (1) to block user input (Windows 98/ME ).

You can adjust the window size of the input box, but there is a minimum size limit: About 190x115 (pixels ). The default size is about 250x190 (pixels ).

The returned string cannot exceed 254 characters. If the input content contains a carriage return or line break, the returned string will be broken by the first character.

The second and other subsequent characters of the password can be used to restrict user input. If the first character is a space, the entered character is visible. If the second character isMIndicates that the input is mandatory (MAndatory), that is, the user must enter at least one character. If no content is entered, pressOKButton, the script does not respond, and the input box does not disappear or return a string.

In addition, you can add a number next to the Password character parameter to specify the maximum length of the input string (see the example below ).

Related

Msgbox

Example

. The following input box is displayed in the upper left corner of the screen and displays the corresponding prompt text.
$ answer = inputbox ( "problem" , "What is your birthplace? " , "Earth" , "" , _
- 1 , - 1 , 0 , 0 )

; the user is required to enter the password. In the actual Program Code , do not forget to provide the password again!
$ passwd = inputbox ( "permission Verification" , "enter the password: " , "" , "*" )

. You must enter 1 or 2 characters. In the Password character parameter, M indicates that null strings are not accepted.
while Number 2 indicates that only two characters can be entered.
$ value = inputbox ( "test" , "Enter 1 or 2 characters: " , "" , "m2" )

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.