AskText

InstallShield 2014 » InstallScript Language Reference

Project: This information applies to the following project types:

InstallScript
InstallScript MSI

The AskText function displays a dialog that contains one static text field and one edit box. Specify default text for the static text field in the parameter szQuestion. Specify default text for the edit box in the parameter szDefault.

Note: You cannot use the PlaceWindow function in conjunction with the AskText function. By default, the dialog appears in the center of the desktop, unless the background window mode is enabled. If the installation is in window mode, the dialog opens in the center of the background window.

The default title of this dialog is Enter Information. To change the contents of the title bar, call SetDialogTitle before calling AskText.

Syntax

AskText ( szQuestion, szDefault, svResult );

Parameters

AskText Parameters

Parameter

Description

szQuestion

Specifies the question or statement to display. If the length of the string in this parameter exceeds the width of the static text field, one or more line breaks will be inserted into the string so that it displays on multiple lines in the dialog. If you prefer, you can format the string manually by inserting one or more newline escape sequences ( \n ) into it. This parameter does not have a default value.

szDefault

Specifies the default text for the edit box. The edit box scrolls, if necessary, to accommodate a long string.

svResult

Returns the text entered by the end user when the Next button is clicked to close the dialog. If the user clicks the Back button, the value of svResult will be unpredictable. Therefore, if you are using the same variable for both szDefault and svResult, be sure to reinitialize that variable when the return value from AskText is BACK.

Note: The string variable that you pass in svResult must be large enough to accommodate the text entered into the edit box. For that reason, you should use the autosize method to declare the variable.

Return Values

AskText Return Values

Return Value

Description

NEXT (1)

Indicates that the end user clicked the Next button.

BACK (12)

Indicates that the end user clicked the Back button.

Additional Information

The dialog that is displayed by the AskText function cannot be displayed with a skin; it appears the same regardless of whether you have specified a skin.

See Also