![](templates/Classic/images/spacer.gif) |
Celerra7 Novice
Joined: 28 Jan 2010 Posts: 34
|
Posted: Sun Jan 16, 2011 10:08 pm
Changing a Multistate Button state using cmd line or script [SOLVED] |
I am trying to activate a specific state within a multistate button using the #BU command. This works fine with toggle buttons: #BU <button_id> 0 or #BU <button_id> 1. These work fine to turn a button off or on that is a toggle button, but not when I try to use the same function on a multistate button: #BU <button_id> 3. I would have assumed this command would set the 3rd state of the button. The only information I get back is the button has not changed and is still in the current state (I have a #SA statement for each state when it is activated, so I am confident which state I have entered into).
Can anyone give me a suggestion on managing this issue and programmatically setting a state without using the mouse to click the button and selecting from the menu?
Thanks, and have a great day.
Celerra7
Cmud 3.33a, Win7 |
|
Last edited by Celerra7 on Mon Jan 17, 2011 9:54 pm; edited 1 time in total |
|
|
![](templates/Classic/images/spacer.gif) |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Jan 17, 2011 3:40 pm |
First, are you sure that there is a state 3 for the button? Remember that the states start numbering at 0.
|
|
|
![](templates/Classic/images/spacer.gif) |
Zugg MASTER
![](images/avatars/164475849040f41c23b22fe.gif)
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Jan 17, 2011 5:17 pm |
The best way to do this is to enter a Variable Name into the Button options and then set the variable to the desired state. When the variable changes, the button will change states and execute the script for the new state. If you manually change the button state with the mouse, the variable will also be set to the correct state number. Works better than the #BUTTON command.
|
|
|
![](templates/Classic/images/spacer.gif) |
Celerra7 Novice
Joined: 28 Jan 2010 Posts: 34
|
Posted: Mon Jan 17, 2011 9:46 pm Changing a Multistate Button state using cmd line or script - RESOLVED |
Zugg,
Man, that works so great. I was using the Button Variable to read what the state of the button was - never thought to change the variable in order to set the state. That's so cool, and works exacly the way I want, since you cannot get to the Default (0) state of the button through clicking the button. Thank you very much for a perfect solution.
Celerra7
CMUD 3.33a, Win7 |
|
|
![](templates/Classic/images/spacer.gif) |
|
|