分类:
2009-03-27 18:31:27
InstallShield 2009 » InstallScript Language Reference
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
AskText ( szQuestion, szDefault, svResult );
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. 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 Value |
Description |
---|---|
NEXT (1) |
Indicates that the end user clicked the Next button. |
BACK (12) |
Indicates that the end user clicked the Back button. |
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
InstallShield Help Library 5 June 2008 | | |
Popup | ||||
InstallShield 2009 » InstallScript Language Reference
Note
To call this function in a Basic MSI setup, you must first create a custom action for the entry-point function, execute the custom action in a sequence or as the result of a dialog's control event, and then build the release.
/*-----------------------------------------------------------*\
*
* InstallShield Example Script
*
* Demonstrates the AskText function.
*
* This script gets a company name from the end user.
*
\*-----------------------------------------------------------*/
#define MSG_TEXT "Please enter your company name."
#define DEFAULT_COMPANY "Acresso Software"
// Include Ifx.h for built-in InstallScript function prototypes.
#include "Ifx.h"
export prototype ExFn_AskText(HWND);
function ExFn_AskText(hMSI)
STRING svCompany, szTitle;
NUMBER nResult;
begin
// Get the company name.
nResult = AskText (MSG_TEXT, DEFAULT_COMPANY, svCompany);
if nResult = NEXT then
// Display the company name that was entered by the user.
MessageBox ("Company: " + svCompany, INFORMATION);
endif;
end;
InstallShield Help Library 5 June 2008 | | |
Popup | ||||