Rad Posted January 29, 2007 Share Posted January 29, 2007 Is there any method to shorten my While loop when I need to check when one of 8x2 buttons have been checked? Like, i have a form with 8 inputs, followed by 2 buttons each "Change" and "Open" They are all in arrays: $input[8], $ChangeInput[8], $LaunchInput[8] Is there anything, like switch or select, to detect when ANY of the buttons have been pressed, but still send the index into the statement? Like this: Select $msg Case $ChangeInput Msgbox(0,"",$Input[@index]) Case $OpenInput FileOpen(...) Endselect Something like that, they wont actually show a message box and fileopen(), but just an example of what i mean I looked at helpfile, it doesnt show anything at least where I was looking Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 30, 2007 Moderators Share Posted January 30, 2007 Although I think I know what you are asking... a working example so I don't waste my time would be nice. 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...
BALA Posted January 30, 2007 Share Posted January 30, 2007 (edited) Just use a For Loop $num = 1 For $i to 8 ; Loops 8 times If $input[$num] Then ;Do whatever here EndIf If $ChangeInput[$num] Then ;Do whatever here EndIf If $LaunchInput[$num] Then ;Do whatever here EndIf $num += 1 ;adds 1 to $num If $num > 8 $num = 1 ; Resets $num EndIf NextoÝ÷ ØçÜ¢êì{*.Â¥v¯zÚv+mâ²Özg§¶Ëhr'íæî¶Ú'±ªÞmè§Þ²Çl@ÈOöÈbqçm櫬¬j·Ù^v«¨´éºÚ®¢Ô¨ÁêÞ¶®¶²±ú+¶¢²ÛºÛhĢǢ~Ø^ɪÞ~í触ëH¬¡j÷¢w¬¢g)àº'íí7ê)éºÖ«¬¢²}ý¶wuçméò¢ç;¬¶Ö¤z+hºÖ®¶sbb33c¶çVÒÒ¤f÷"b33c¶Fò bb33c´6ævTçWE²b33c¶çVÕÒFVâ²VFBFò6V6²bFR'WGFöâ2&W76V@ ´FòvFWfW"W&P VæD` bb33c´ÆVæ6çWE³ÒFVâ²VFBFò6V6²bFR'WGFöâ2&W76V@ ´FòvFWfW"W&P VæD` b33c¶çVÒ³Ò¶FG2Fòb33c¶çVÐ bb33c¶çVÒfwC² b33c¶çVÒÒ²&W6WG2b33c¶çVÐ VæD`¤æW@oÝ÷ Ù±!1!?Û8«(é¨é¨v'âq«b¢{%¢QhÊ'²Ö§¶%)àjëh×6$num = 1 While 1 If $ChangeInput[$num] Then ;Do whatever here EndIf If $LaunchInput[8] Then ;Do whatever here EndIf $num += 1 ;adds 1 to $num If $num > 8 $num = 1 ; Resets $num EndIf sleep(10) ; Lower CPU usage WEndoÝ÷ ØZ+¢wg©¢Yb®¶sbb33c¶çVÒÒ¤f÷"b33c¶Fò bb33c´6ævTçWE²b33c¶çVÕÒFVà ´FòvFWfW"W&P VæD` bb33c´ÆVæ6çWE³ÒFVà ´FòvFWfW"W&P VæD` b33c¶çVÒ³Ò¶FG2Fòb33c¶çVФæW@ Edited January 30, 2007 by BALA [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
Rad Posted January 30, 2007 Author Share Posted January 30, 2007 Oh yeah, that makes sense thanks lol I havent used autoit in awhile and kinda forgot everything... i blame my new C++ class and HTML/CSS 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