Sign in to follow this  
Followers 0
Info

Possible?

6 posts in this topic

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?

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

For $n = 0 To 100
    Send(StringFormat("%03u", $n))
    Sleep(1000)
Next



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0