cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Daniel_Dority
Level 6

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.
Labels (1)
0 Kudos
(3) Replies
Daniel_Dority
Level 6

It is setting the global variable.....

cheaters!

So then why pass it in the first place?
0 Kudos
RobertDickau
Flexera Alumni

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.
0 Kudos
Daniel_Dority
Level 6

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!
0 Kudos