Input box

Syntax

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

 

Parts

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

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

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. Option can be used only when keyword inp begins statement.

 

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 invisible (* characters). Else, if default begins with "[]", text can be multiline.

 

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" ""