- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: How to return value from call to dialog box
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
How to return value from call to dialog box
I have code below which opens a custom dialog box which I created. When I call my dialog box I pass in a value for nPut, as I initailize it to the word "Test". When my dialog box code is called I change the value of nPut, but when the dialog box closes and control returns on line 4 the value for nPut is still the value which I originally assigned to it "Test". That is even thought I changed the value in the dialog .rul code. So how can I permanently change the value for nPut so that the value is returned on line 4 below? In C# we can do this by passing by reference.
1. string nPut;
2. nPut="Test";
3. Dlg_GetCashPreference:
4. nResult= dlgAskForPreference(nPut);
Hi @ralphster ,
You can achieve that by defining the method parameter as BYREF
See the below example:
prototype object TestReference(BYREF STRING);
function object TestReference(strobj)
begin
strobj = "TestREturn";
return strobj;
end;
///////
strTest = "TestCall";
strReturn = TestReference(strTest);
///