anystupidassname Posted February 15, 2008 Share Posted February 15, 2008 (edited) The problem is that all of the For In Next, Do Until, While WEnd, seem to be for trying the same thing over and increasing a variable each time until it reaches a set limit. Is there a more elegant way to do this than a bunch of if elseif thens? The actions I need to try in the correct order should only be performed once each and once the condition is met the rest of the actions MUST NOT be performed. I hope this makes sense. $clipstart = ClipGet() if ClipGet() = blah or blah1 or $clipstart then first set of actions elseif ClipGet() = blah or blah1 or $clipstart then second set of actions elseif ClipGet() = blah or blah1 or $clipstart then third actions EndIf Thanks Edited February 15, 2008 by anystupidassname This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#....... Link to comment Share on other sites More sharing options...
Aceguy Posted February 15, 2008 Share Posted February 15, 2008 are you reading from the clipboard.? [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
anystupidassname Posted February 15, 2008 Author Share Posted February 15, 2008 are you reading from the clipboard.?Yes, but ignore that. I'm trying to do something until the clipboard contains a certain thing.Here is a second part to the question too.What if I have to try pressing down arrow once and then enter and if that doesn't work, press down twice and enter ad nauseum? This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#....... Link to comment Share on other sites More sharing options...
martin Posted February 15, 2008 Share Posted February 15, 2008 The problem is that all of the For In Next, Do Until, While WEnd, seem to be for trying the same thing over and increasing a variable each time until it reaches a set limit.Is there a more elegant way to do this than a bunch of if elseif thens?The actions I need to try in the correct order should only be performed once each and once the condition is met the rest of the actions MUST NOT be performed. I hope this makes sense.$clipstart = ClipGet()if ClipGet() = blah or blah1 or $clipstart thenfirst set of actionselseif ClipGet() = blah or blah1 or $clipstart thensecond set of actionselseif ClipGet() = blah or blah1 or $clipstart thenthird actionsEndIfThanksSwitch/ EndSwitch or Select/EndSelect would be better perhaps. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
anystupidassname Posted February 15, 2008 Author Share Posted February 15, 2008 Switch/ EndSwitch or Select/EndSelect would be better perhaps.Thanks, Select / EndSelect looks good. This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#....... Link to comment Share on other sites More sharing options...
Aceguy Posted February 15, 2008 Share Posted February 15, 2008 #include<array.au3> $clip=ClipGet() $array=StringSplit($clip,@lf) for $ct=1 to $array[0] if $array[$ct] = "whatever you want to search for" Then MsgBox(0,"","Found it! "&$array[$ct],0) EndIf Next [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
NELyon Posted February 15, 2008 Share Posted February 15, 2008 See _ClipContains in my sig 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