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
- :
- Return Values - PLEASE HELP!
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
‎Dec 07, 2007
12:28 AM
Return Values - PLEASE HELP!
Hi,
I have an small function, which get the type of the current drive/dir ( INSTALLDIR ). For later proposes, I would like to return the value of var "svType".
I would like to use the return value for conditions for components - How it is possible ?
How can i overwrite an property ( Eigenschaften-Manager in German ) ?
Thanks.
//CODE ################
#include "isrt.h"
#include "iswi.h"
export prototype MyOnMoving(HWND);
NUMBER svType;
function MyOnMoving(hMSI)
_DISK_INFO di;
NUMBER nvResult;
NUMBER nResult;
STRING szInstalldir;
STRING szPerm;
STRING sType;
begin
di.szDiskPath = INSTALLDIR;
di.nInfoToQuery = DISK_INFO_QUERY_ALL;
nvResult = GetDiskInfo( &di );
if ( nvResult = ISERR_SUCCESS ) then
switch ( di.nDriveType )
case DRIVE_UNKNOWN:
svType = 0;
sType = "Unknown";
case DRIVE_NO_ROOT_DIR:
svType = 0;
sType = "No Root Dir";
case DRIVE_REMOVABLE:
svType = 1;
sType = "Removable";
case DRIVE_FIXED:
svType = 1;
sType = "Drive Fixed";
case DRIVE_REMOTE:
svType = 0;
sType = "Remote";
case DRIVE_CDROM:
svType = 0;
sType = "CDROM";
case DRIVE_RAMDISK:
svType = 1;
sType = "RAMDISK";
endswitch;
endif;
I have an small function, which get the type of the current drive/dir ( INSTALLDIR ). For later proposes, I would like to return the value of var "svType".
I would like to use the return value for conditions for components - How it is possible ?
How can i overwrite an property ( Eigenschaften-Manager in German ) ?
Thanks.
//CODE ################
#include "isrt.h"
#include "iswi.h"
export prototype MyOnMoving(HWND);
NUMBER svType;
function MyOnMoving(hMSI)
_DISK_INFO di;
NUMBER nvResult;
NUMBER nResult;
STRING szInstalldir;
STRING szPerm;
STRING sType;
begin
di.szDiskPath = INSTALLDIR;
di.nInfoToQuery = DISK_INFO_QUERY_ALL;
nvResult = GetDiskInfo( &di );
if ( nvResult = ISERR_SUCCESS ) then
switch ( di.nDriveType )
case DRIVE_UNKNOWN:
svType = 0;
sType = "Unknown";
case DRIVE_NO_ROOT_DIR:
svType = 0;
sType = "No Root Dir";
case DRIVE_REMOVABLE:
svType = 1;
sType = "Removable";
case DRIVE_FIXED:
svType = 1;
sType = "Drive Fixed";
case DRIVE_REMOTE:
svType = 0;
sType = "Remote";
case DRIVE_CDROM:
svType = 0;
sType = "CDROM";
case DRIVE_RAMDISK:
svType = 1;
sType = "RAMDISK";
endswitch;
endif;
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 07, 2007
01:01 AM
--------------------------------------------------------------------------------
return
InstallShield 12 » InstallScript Language Reference
You can use the return statement to return a value from a user-defined function (if the function prototype does not specify a return type of void). When a return statement is encountered, program flow returns to the point at which the function was called. When used to return from a call to a user-defined function, the return statement can return a specified value to the caller.
The return value of most built-in functions will be either 0 (zero), indicating the success of the function, or a value less than zero (< 0), indicating failure. You can assign a number to the return value by using a return statement above the end statement in the function block, as shown below:
return -1;
end;
This attribute allows you to return the value of a local variable to the caller, even though the local variable itself is destroyed:
function MyFunction(ParamOne, ParamTwo)
NUMBER nNumber;
begin
nNumber = (ParamOne + ParamTwo);
// . . .
return nNumber;
end;
return
InstallShield 12 » InstallScript Language Reference
You can use the return statement to return a value from a user-defined function (if the function prototype does not specify a return type of void). When a return statement is encountered, program flow returns to the point at which the function was called. When used to return from a call to a user-defined function, the return statement can return a specified value to the caller.
The return value of most built-in functions will be either 0 (zero), indicating the success of the function, or a value less than zero (< 0), indicating failure. You can assign a number to the return value by using a return statement above the end statement in the function block, as shown below:
return -1;
end;
This attribute allows you to return the value of a local variable to the caller, even though the local variable itself is destroyed:
function MyFunction(ParamOne, ParamTwo)
NUMBER nNumber;
begin
nNumber = (ParamOne + ParamTwo);
// . . .
return nNumber;
end;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 07, 2007
01:07 AM
Chikura wrote:
--------------------------------------------------------------------------------
return
InstallShield 12 » InstallScript Language Reference
You can use the return statement to return a value from a user-defined function (if the function prototype does not specify a return type of void). When a return statement is encountered, program flow returns to the point at which the function was called. When used to return from a call to a user-defined function, the return statement can return a specified value to the caller.
The return value of most built-in functions will be either 0 (zero), indicating the success of the function, or a value less than zero (< 0), indicating failure. You can assign a number to the return value by using a return statement above the end statement in the function block, as shown below:
return -1;
end;
This attribute allows you to return the value of a local variable to the caller, even though the local variable itself is destroyed:
function MyFunction(ParamOne, ParamTwo)
NUMBER nNumber;
begin
nNumber = (ParamOne + ParamTwo);
// . . .
return nNumber;
end;
How can i call the function from installshield ?
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)