Jump to content

Recommended Posts

Posted

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?

Posted

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

Posted

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?

Posted

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...