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
- :
- Returning a value in a function
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
‎Jun 26, 2008
12:45 PM
Returning a value in a function
Hey there,
I've successfully created a custom dialog and actually got the thing to display. Now I need to return a value.
I've been looking at the examples and most functions return an interger or code which informs the calling method that the user hit back.
What I don't understand (yet) is how some functions return values.
Here's an example:
// Parameters that get passed into the function
szName = ""
szTitle = ""
// Parameters that get returned
// svVariable
// svVariable2
MyFunction(szName, szTitle, svVariable, svVariable2);
How in the world do I populate svVariable and svVariable2 in my custom function? Is it cheating by using the global variables above? If so, then why would I need to pass those values in in the first place?
There has to be something I am missing, but I haven't found the solution yet.
Any help is appreciated.
thanks.
I've successfully created a custom dialog and actually got the thing to display. Now I need to return a value.
I've been looking at the examples and most functions return an interger or code which informs the calling method that the user hit back.
What I don't understand (yet) is how some functions return values.
Here's an example:
// Parameters that get passed into the function
szName = ""
szTitle = ""
// Parameters that get returned
// svVariable
// svVariable2
MyFunction(szName, szTitle, svVariable, svVariable2);
How in the world do I populate svVariable and svVariable2 in my custom function? Is it cheating by using the global variables above? If so, then why would I need to pass those values in in the first place?
There has to be something I am missing, but I haven't found the solution yet.
Any help is appreciated.
thanks.
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 26, 2008
12:55 PM
It is setting the global variable.....
cheaters!
So then why pass it in the first place?
cheaters!
So then why pass it in the first place?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 26, 2008
01:11 PM
You'll want to look into "BYREF" arguments passed to your function; the source code for the Sd dialog boxes (in the Script/isrt/src folder or thereabouts in your InstallShield distribution) should have many examples.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 26, 2008
01:17 PM
Ah that explains my incorrect syntax with it.
After I hit post, I remembered that keyword.
I see you only call BYREF in the prototype call, not the actual function call. That was my mistake, thanks a bunch!
After I hit post, I remembered that keyword.
I see you only call BYREF in the prototype call, not the actual function call. That was my mistake, thanks a bunch!