nitro322 Posted June 3, 2006 Share Posted June 3, 2006 (edited) Is there a more compact method of doing this? if GUICtrlRead($gain) == $GUI_CHECKED then $replaygain = 1 else $replaygain = 0 endif I have many such statements in my script, which adds up to quite a bit of wasted space. Is there some alternative method I could do this so that each and ever assignment statement doesn't take 5 lines? Eg, in PHP I could do this: if (GUICtrlRead($gain)) == $GUI_CHECKED) $replaygain = 1; else $replaygain = 0; or even better: GUICtrlRead($gain) == $GUI_CHECKED ? $replaygain = 1 : $replaygain = 0; Of course, this isn't PHP, but I was wondering if there was some more optimal way of coding this. Thanks. Edited June 3, 2006 by nitro322 http://www.legroom.net/ Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 4, 2006 Moderators Share Posted June 4, 2006 Assuming your using GUIGetMsg() and this is in the loop you could try this:While 1 $Msg = GUIGetMsg() If $Msg = $gain And BitAND(GUICtrlRead($gain), $GUI_CHECKED) = $GUI_CHECKED Then $replaygain = 1 If $Msg = $gain And BitAND(GUICtrlRead($gain), $GUI_UNCHECKED) = $GUI_UNCHECKED Then $replaygain = 0 WEnd Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now