Information needed when using OnEvent> in TabPages

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
migro
Macro Veteran
Posts: 152
Joined: Thu Nov 06, 2003 5:23 pm
Location: Germany
Contact:

Information needed when using OnEvent> in TabPages

Post by migro » Fri Jul 10, 2009 12:20 pm

When I use the OnEvent function in tabpages I get still the first (old) value (itemindex 0) from this combobox back in the subroutine and not the new (changed) value.

Code: Select all

   OnEvent>DIALOG_CHANGE,Dialog1,combobox1,GetValue
   Show>Dialog1

Label>ActionLoop
   GetDialogAction>Dialog1,rVal
   IF>rVal=2,Init
   IF>rVal=5,ResetDlg
   IF>rVal=6,Close
Goto>ActionLoop

SRT>GetValue
   Let>MyValue=Dialog1.combobox1
   ResetDialogAction>Dialog1
End>GetValue

Label>Init
.....
Any idea appreciated :?
regards
migro

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Jul 10, 2009 3:57 pm

Add GetDialogAction> to the subroutine. It takes GetDialogAction to reset the dialog variables to the newly selected values.

Code: Select all

   OnEvent>DIALOG_CHANGE,Dialog1,combobox1,GetValue
   Show>Dialog1

Label>ActionLoop
   GetDialogAction>Dialog1,rVal
   IF>rVal=2,Init
   IF>rVal=5,ResetDlg
   IF>rVal=6,Close
Goto>ActionLoop

SRT>GetValue
   GetDialogAction>Dialog1,rVal
   Let>MyValue=Dialog1.combobox1
   ResetDialogAction>Dialog1
End>GetValue

Label>Init
.....

User avatar
migro
Macro Veteran
Posts: 152
Joined: Thu Nov 06, 2003 5:23 pm
Location: Germany
Contact:

Post by migro » Fri Jul 10, 2009 11:30 pm

Thanks JRL. Now it works as expected :wink:
regards
migro

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts