Input box

Syntax

int inp[-](var [text] [caption] [default] [checkvar] [checktext] [func] [hwndowner])

 

Parameters

var - receives input. Variable of intrinsic non-pointer type except lpstr.

text - text above the edit field. String. Default: "" (empty). Supports links.

caption - input box title. String. Default: "" ("QM Input").

default - edit control text. String. Default: "" (empty).

checkvar - integer variable. Sets and receives checkbox state (0 or 1). Default: 0 (hide checkbox).

checktext - checkbox text. String. Default: "".

func - name of and user-defined function that is called when text changes. The function must begin with function# str&s. Here s is text of the input box edit field. The function can modify it. The function should return 0. Or, it can return 1 to press OK or 2 to press Cancel. Default: literal 0.

hwndowner (QM 2.2.1) - owner window handle. The dialog box will be on top of the owner window. The owner window, if belongs to the same thread, will be disabled. Default: 0.

 

Options:

- on 'Cancel' end macro.

 

Remarks

Displays input dialog box. If user selects OK, populates var with input value and returns 1. Else returns 0.

 

If default begins with "*", text is hidden (use for password). Else, if default begins with "[]" (new line), text can be multiline.

 

See also: InputBox.

Tips: If need more input fields, instead create a dialog.

 

Examples

int i
inp i

str p
int rem = 1
inp- p "Password" "" "*" rem "Remember"
if(p = "p11") ret rem
else mes- "x" "Password incorrect" ""