Radiogroup (three, each on seperate tabs) help.

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
aboredprogrammer
Junior Coder
Posts: 40
Joined: Wed Jan 27, 2010 6:31 am

Radiogroup (three, each on seperate tabs) help.

Post by aboredprogrammer » Thu Feb 18, 2010 6:50 am

Hello,
I have three tabs on my dialog. Each tab has one radiogroup on it. What I'm currently struggling with is this below. It will not respond for some odd reason? Am I able to use this code below?

Code: Select all

Label>dialogoptions
    GDA>dialog1,res1
If>res1=2,exit
If>res1=10,check_settings
If>res1=20,pause
If>res1=30,about
If>dialog1.msLabel12=           About...
Let>dialog1.msLabel12=Waiting for selections...
    RDA>dialog1
Endif
Goto>dialogoptions

Label>check_settings
If>{(%dialog1.msRadiogroup1.ItemIndex%=0) and (%dialog1.msRadiogroup2.ItemIndex%=-1) and (%dialog1.msRadiogroup3.ItemIndex%=-1)}
    Goto>BM_Fast
    Endif
If>{(%dialog1.msRadiogroup1.ItemIndex%=1) and (%dialog1.msRadiogroup2.ItemIndex%=-1) and (%dialog1.msRadiogroup3.ItemIndex%=-1)}
    Goto>BM_Medium
    Endif
If>{(%dialog1.msRadiogroup1.ItemIndex%=2) and (%dialog1.msRadiogroup2.ItemIndex%=-1) and (%dialog1.msRadiogroup3.ItemIndex%=-1)}
    Goto>BM_Slow
    Endif
Goto>check_settings
Thanks again, I seem to always get stuck on simple things :x
aboredprogrammer

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

Post by JRL » Thu Feb 18, 2010 5:53 pm

I don't see anything fundamentally wrong with your code. I assume the Labels all exist and are correct case and no trailing spaces.

When stepping through this in the editor, what do you see?

User avatar
aboredprogrammer
Junior Coder
Posts: 40
Joined: Wed Jan 27, 2010 6:31 am

Post by aboredprogrammer » Thu Feb 18, 2010 6:42 pm

I'm beginning to this it's something with the IF statements I will post below. Because, when the dialog starts, I can click the "About" button I created, and the "Pause" button I created, but when I click the "Start button, it freezes up. Here is the code below where I think it might be getting stuck...

Code: Select all

Label>dialogoptions
    GDA>dialog1,res1
If>res1=2,exit
If>res1=10,check_settings
If>res1=20,pause
If>res1=30,about
If>dialog1.msLabel12=           About...
Let>dialog1.msLabel12=Waiting for selections...
Endif
    RDA>dialog1
Endif
Goto>dialogoptions
Thanks for your time JRL
aboredprogrammer

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

Post by JRL » Thu Feb 18, 2010 7:01 pm

Perhaps move the ResetDialogAction> up into the "dialog1.msLabel12" If statement. Try to keep ResetDialogAction> out of the main loop. Instead, place it in other Label blocks and Subroutines. Probably need it in all of them that are called to by action in the dialog

Code: Select all

Label>dialogoptions
  GDA>dialog1,res1
  If>res1=2,exit
  If>res1=10,check_settings
  If>res1=20,pause
  If>res1=30,about
  If>dialog1.msLabel12=           About...
    Let>dialog1.msLabel12=Waiting for selections...
    RDA>dialog1
  Endif
    
//Endif <--I don't see why you need this
Goto>dialogoptions

User avatar
aboredprogrammer
Junior Coder
Posts: 40
Joined: Wed Jan 27, 2010 6:31 am

Post by aboredprogrammer » Thu Feb 18, 2010 10:46 pm

- SOLVED - Thanks to JRL.

I just tried saying "Thank you" by giving you REP, but I receive an error saying:

"Information
To give reputation the same user you should spread it around."

The sentence doesn't make too much sense, but I believe what it's telling me is that I gave you too much REP. Haha.

Consider this message me giving you more.
aboredprogrammer

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