Hassan Posted January 28, 2009 Share Posted January 28, 2009 I am facing a big confusion in my mind related to "For" & "While" loop give me a little idea about both these two loops. more over If I start a loop with while and then give conditions like as follow, just tell me is it the proper way to do that or I should do something elseWhileIf("ABC") ThenWinexit("vhvsh")EndifIf("GHT") ThenWinexit("pieoph")EndifIf("4545") ThenWinexit("kjqhjq")Endifand next time an other string with another function but again in If used & it close & End if & again & again between While loop is Ok or I should try something different to make my source code a little smallWEnd Link to comment Share on other sites More sharing options...
martin Posted January 28, 2009 Share Posted January 28, 2009 I am facing a big confusion in my mind related to "For" & "While" loop give me a little idea about both these two loops. more over If I start a loop with while and then give conditions like as follow, just tell me is it the proper way to do that or I should do something else While If ("ABC") Then Winexit("vhvsh") Endif If ("GHT") Then Winexit("pieoph") Endif If ("4545") Then Winexit("kjqhjq") Endif and next time an other string with another function but again in If used & it close & End if & again & again between While loop is Ok or I should try something different to make my source code a little small WEnd For loops let you execute a set of instructions a fixed number of times. A while loop keeps executing the code untill the condition is not true any more, which could never happen. You could have If $string1 = "abcd" then do something EndIf The example you gave wouldn't actually work in AutoIt because a non empty string will evaluate to true. (Even "0") But otherwise the construction you showed is ok. I can't answer the last sentence of your post because I don't understand it. 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...
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