This is a rough, fictional example but similar to my script except that I've removed pre-initialization for global variables that are used in the dialog blocks. I'm trying to figure out why the dialog field Last Name: shows Unknown instead of Smith.
Let>VAREXPLICIT=1
// initialize Last_name but not First_name before dialog blocks
Let>Last_name={"Unknown"}
// watch: Last_name=Unknown
Dialog>MyName
// typical dialog lines
Label={"First Name:"},16,24
Edit={"Firstname"},48,16,145,%First_name%
Label={"Last Name:"},224,24
Edit={"Lastname"},264,16,153,%Last_name%
// more typical dialog lines
EndDialog>MyName
// watch: MyName.Firstname=%First_name%
// watch: MyName.Lastname=Unknown
Let>First_name="John"
// watch: First_name=John
Let>Last_name="Smith"
// watch: Last_name=Smith
Let>MyName.Firstname=%First_name%
// watch: MyName.Firstname=John
Let>MyName.Lastname=%Last_name%
// watch: MyName.Lastname=Smith
Show>MyName
// watch: MyName.Firstname=%First_name%
// dialog field First Name: John
// watch: MyName.Lastname=Unknown
// dialog field Last Name: Unknown
So again, one solution if I want the dialog field Last Name to show Smith is to not initialize the global variable before the dialog blocks but why?
Thanks
When, how are dialogs initialized?
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
After changing the variables that represent dialog object values you need to do:
ResetDialogAction>MyName
This updates the dialog with the values of MyName.LastName etc.
ResetDialogAction>MyName
This updates the dialog with the values of MyName.LastName etc.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?