Sign in to follow this  
Followers 0
Hidden

Sending(0001) as opposed to 1

4 posts in this topic

Hey guys,

 

I tried to sort this out myself but I'm having some issues (probably since I've never used this kind of thing before.

What I'm trying to accomplish:

Send the number 0001 to start with, and then simply keep adding one and continue sending, all the way to 9999.

 

What I tried:

$Number = 0001

While 1 = 1

Send($Number)

$Number = $Number + 1 ;(I tried 0001 here as well)

Sleep(1000)

Send("{ENTER}")

WEnd

 

The result is that it keeps sending them like so:

1

2

3

4

5...

 

Is there a way to make it take the 0's into account as well? So it comes out as:

0001

0002

0003...

 

Thank you in advance.

Share this post


Link to post
Share on other sites



You are a champion, thank you for that, it works like a charm.

For my brain to be at peace, can you please explain to me how "%04i" defines the format? Or is it simply a pre-set thing?

Share this post


Link to post
Share on other sites

It's a preset thing, but changing 4 to 5 will give you a clue. Look at StringFormat in the help file. Happy to help. :)

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