Page 1 of 1
Displaying variable values in text boxes on dialog
Posted: Wed Mar 11, 2009 6:19 pm
by jimdalrymp
I want to display a default database name in a text box on a custom dialog.
At the top of my script:
Set Persistent Variable DEFAULTDBNAME to RMSDBSQL
In the text property of the text box:
$DEFAULTDBNAME$
When I run the setup in debug mode, the text box is just blank. A watch shows that the variable is populated with "RMSDBSQL".
What am I doing wrong?
Also, I have two option buttons:
Server Authentication
Windows Authentication
The Checked property for the Server control is True and the Checked property for the Windows control is False, but when the dialog displays in debug mode, the Windows control is checked and the Server control is not checked. What is going on?
Thanks for the help.
Posted: Wed Mar 11, 2009 9:44 pm
by MichaelNesmith
Set your build mode to uncompressed and remove the debug flag and see if that fixes your problem.
Posted: Thu Mar 12, 2009 11:22 am
by jimdalrymp
Thank you for the quick reply.
I have been using the Uncompressed build mode and the Debug Build check box was not checked.
I place a LABEL control onto the form where the caption property referenced a variable in the script and it displayed the variable value on the form without a problem. So it seems that the problem is how to do this using an EDIT control?
Posted: Thu Mar 12, 2009 11:45 am
by MichaelNesmith
You may want to provide more details or post a minimum version of your project which illustrates this issue.
Posted: Thu Mar 12, 2009 12:23 pm
by jimdalrymp
Attached is a folder with a sample project that shows a script variable successfully displayed in a label control on the welcome form, but unsuccessfully displayed in a edit control on the same form.
Thanks again for your help.
File Attached:
TestCustomDialog.zip
Posted: Thu Mar 12, 2009 1:40 pm
by MichaelNesmith
Mistake. You have to set Object Behavior -> Receives Information to [Written Variable Value] and Object Behavior -> Writes Values to Variable to your variable name.
Double click the edit box to see all object behaviors.
Posted: Thu Mar 12, 2009 1:44 pm
by bokkie
Jim,
I don't think edit boxes work the same way as labels. That is, pumping the variable name into the text property will not work like it will pumping the variable name into the label caption.
Instead, you might as well remove the variable name from the text property. Then double-click on the edit box and select the
Object Behavior tab. Change the
Receives Information and select
[Written Variable Value] and in
Write Values to Variable enter
$DEFAULTINSTANCE$. That will give the default value you are after and you can then edit it as necessary at runtime. You should then be good-to-go.
Hope this helps.
EDIT: I just noticed that Michael beat me by a few minutes with the same answer. His pre-confirms mine.

Posted: Thu Mar 12, 2009 5:28 pm
by jimdalrymp
That did the trick. Thank you!