Info Posted February 26, 2008 Posted February 26, 2008 I want the Send function to Send all 100 numbers from 000 to 100 without writing it over and over like: Send ( "000") Send ( "001") Send ( "002") Send ( "003") Send ( "004") Send ( "005") Send ( "006") Send ( "007") Possible?
CodeMaster Rapture Posted February 26, 2008 Posted February 26, 2008 You could try something like: Dim $iCount = 0 Dim $szString = "" For $iCount = 0 to 100 If ($iCount < 10) Then $szString &= "00" & $iCount & @CRLF ElseIf ($iCount < 100) Then $szString &= "0" & $iCount & @CRLF Else $szString &= $iCount & @CRLF EndIf Next Send($szString) Or you could use StringFormat("%3s",$szString) instead of the If statements. I'm not sure if it will print the preceeding zeros though. -CMR
PsaltyDS Posted February 26, 2008 Posted February 26, 2008 For $n = 0 To 100 Send(StringFormat("%03u", $n)) Next Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Info Posted February 27, 2008 Author Posted February 27, 2008 Thank you And if I want it to Send just one number from all the 100, and then do something, and then the next number, like: Send ( "001") Sleep ( 1000 ) Send ( "002") Sleep ( 1000 ) Send ( "003") Sleep ( 1000 ) Send ( "002") Sleep ( 1000 ) Send ( "004") How?
BigDod Posted February 27, 2008 Posted February 27, 2008 For $n = 0 To 100 Send(StringFormat("%03u", $n)) Sleep(1000) Next Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
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