Jump to content
Sign in to follow this  

How to display a 2-digits variable in Dos command

Recommended Posts



I'm new to autoit and I have a problem to print a "2-digit" variable in DOS command prompt.

Here is my code.

Dim $i


While $i <=11



Send("{" & $i & "}")

sleep (2000)


send("type digonly.txt|sed -e 1,3d -e5,8d > 9_")


sleep (1000)






When I run the above program, the variable,i, should start from "10" but as I send i to DOS prompt by using "Send("{" & $i & "}")" the result output in DOS prompt is "1".

I am so confused that why it cannot display "10" in command prompt.

Please some one help me. Thank you so much!

Share this post

Link to post
Share on other sites

I don't know if this is why it doesn't work as expected, but you have the syntax wrong for the WinWaitActive command.

Function WinWaitActive

Also, the WinClose syntax is wrong too.<br><br>Edit: For the actual problem though, try this. Change the value here, SendKeyDelay (Option), it defaults to 5, try 10 or higher..<br>

Edited by snowmaker

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post

Link to post
Share on other sites

I changed Send("{" & $i & "}") to Send(&i) and problem solved.

As to other incorrect usage, I will look into it.

Thanks for the reply.

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.