This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- nResult always equal to 0 with CustomDialog
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 31, 2009
04:11 PM
nResult always equal to 0 with CustomDialog
Hi;
New IS user, took the class last summer, just getting into coding now.
I am trying to use the example in Chapter 9, Custom Dialog Boxes, from the Learning InstallScript Projecs Using InstallShield 2008. I am using v2009 now.
I can get the CustomDialog to display without error, but I cannot get Back button to go back from the CustomDialog screen. Code snip-its:
In the CustomDialog.rul:
case BACK_BUTTON:
nReturn = SD_PBUT_BACK;
NumToStr(szTemp, nReturn);
MessageBox("nReturn:" + szTemp, INFORMATION);
bDone = TRUE;
*** I see a value of '12' in the message box.
In the Setup.rul:
nResult = CD( );
NumToStr(szTemp, nResult);
MessageBox("nResult:" + szTemp, INFORMATION);
if (nResult = SD_PBUT_BACK) goto Dlg_SdWelcome;
*** I see a value of '0' in the message box. So the above If is
false and my script falls thru to the next dialog.
I did some searching in the other threads, but could not any help.
Thanks for your time!
Regards,
Bill
New IS user, took the class last summer, just getting into coding now.
I am trying to use the example in Chapter 9, Custom Dialog Boxes, from the Learning InstallScript Projecs Using InstallShield 2008. I am using v2009 now.
I can get the CustomDialog to display without error, but I cannot get Back button to go back from the CustomDialog screen. Code snip-its:
In the CustomDialog.rul:
case BACK_BUTTON:
nReturn = SD_PBUT_BACK;
NumToStr(szTemp, nReturn);
MessageBox("nReturn:" + szTemp, INFORMATION);
bDone = TRUE;
*** I see a value of '12' in the message box.
In the Setup.rul:
nResult = CD( );
NumToStr(szTemp, nResult);
MessageBox("nResult:" + szTemp, INFORMATION);
if (nResult = SD_PBUT_BACK) goto Dlg_SdWelcome;
*** I see a value of '0' in the message box. So the above If is
false and my script falls thru to the next dialog.
I did some searching in the other threads, but could not any help.
Thanks for your time!
Regards,
Bill
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 31, 2009
05:28 PM
Could something else later in your CD function be changing the return value to 0?
(As an aside, you can use SprintfBox to display a number value without needing NumToStr or an auxiliary variable...)
(As an aside, you can use SprintfBox to display a number value without needing NumToStr or an auxiliary variable...)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 02, 2009
11:59 AM
Thanks for the tip about displaying values.
Here is my entire cd.rul:
prototype NUMBER CD ( );
function NUMBER CD ( )
#define DUDE_BUTTON 1302
#define CANCEL_BUTTON 9
#define BACK_BUTTON 12
#define NEXT_BUTTON 1
BOOL bDone;
NUMBER nReturn, nCtrl;
STRING szTemp;
begin
EzDefineDialog ("CD", ISUSER, "CD", NULL);
while (!bDone)
nCtrl = WaitOnDialog("CD");
switch (nCtrl)
case DUDE_BUTTON:
MessageBox("You clicked Dude.", INFORMATION);
case BACK_BUTTON:
MessageBox("You clicked Back.", INFORMATION);
nReturn = SD_PBUT_BACK;
NumToStr(szTemp, nReturn);
MessageBox("nReturn:" + szTemp, INFORMATION);
bDone = TRUE;
case NEXT_BUTTON:
MessageBox("You clicked Next.", INFORMATION);
nReturn = SD_PBUT_OK;
bDone = TRUE;
case CANCEL_BUTTON:
MessageBox("You clicked Cancel.", INFORMATION);
Do(EXIT);
case SD_PBUT_CANCEL:
MessageBox("You clicked the little x to Cancel.", INFORMATION);
Do(EXIT);
endswitch;
endwhile;
EndDialog("CD");
ReleaseDialog("CD");
end;
Here is my entire cd.rul:
prototype NUMBER CD ( );
function NUMBER CD ( )
#define DUDE_BUTTON 1302
#define CANCEL_BUTTON 9
#define BACK_BUTTON 12
#define NEXT_BUTTON 1
BOOL bDone;
NUMBER nReturn, nCtrl;
STRING szTemp;
begin
EzDefineDialog ("CD", ISUSER, "CD", NULL);
while (!bDone)
nCtrl = WaitOnDialog("CD");
switch (nCtrl)
case DUDE_BUTTON:
MessageBox("You clicked Dude.", INFORMATION);
case BACK_BUTTON:
MessageBox("You clicked Back.", INFORMATION);
nReturn = SD_PBUT_BACK;
NumToStr(szTemp, nReturn);
MessageBox("nReturn:" + szTemp, INFORMATION);
bDone = TRUE;
case NEXT_BUTTON:
MessageBox("You clicked Next.", INFORMATION);
nReturn = SD_PBUT_OK;
bDone = TRUE;
case CANCEL_BUTTON:
MessageBox("You clicked Cancel.", INFORMATION);
Do(EXIT);
case SD_PBUT_CANCEL:
MessageBox("You clicked the little x to Cancel.", INFORMATION);
Do(EXIT);
endswitch;
endwhile;
EndDialog("CD");
ReleaseDialog("CD");
end;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 02, 2009
03:45 PM
It appears CD isn't actually returning a value. Maybe add return nReturn; to the end of the CD function?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 02, 2009
06:29 PM
Hi Robert;
As you suggested, using a return nReturn worked, Thank You!
Regards,
Bill
As you suggested, using a return nReturn worked, Thank You!
Regards,
Bill