Sign in to follow this  
Followers 0
creamauto

01 as number

10 posts in this topic

okay..i want autoit to enter 01 in a text box, then i am making it loop trying to add 1 to the 01 like i have:

while 1

$defnumber= 01

If $defnumber= 01 then

$defnumber= $defnumber +1

EndIf

wend

but the problem is it never enters the 0 infront so i tried

while 1

$defnumber= "01"

If $defnumber= 01 then

$defnumber= $defnumber +1

EndIf

wend

but still i get 2 as input then 3 ect... but i need it to go 01, 02, 03 entering in the textbox, then finally once if defnumber= 09 then $defnumber= 10 and ect....

plz help me, thanks

Share this post


Link to post
Share on other sites



If you want to pad zero's to the left of you integer, then you may need to use StringFormat().

:lmao:

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

you mean like:

$defnumber= StringFormat("01")

if so, how would i edit :

If $defnumber= "01" then

$defnumber= $defnumber +1

EndIf

how would i edit that?

Edited by creamauto

Share this post


Link to post
Share on other sites

you mean like:

$defnumber= StringFormat("01")

if so, how would i edit :

If $defnumber= "01" then

$defnumber= $defnumber +1

EndIf

how would i edit that?

Did you bother to look at StringFormat() in the help file on how to use it, before you posted the murderous code above?

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

no,. im a noob ok? -__- im having trouble just rtying to loop a variable $num= 0 and loop it until $num= 9 -____-

Share this post


Link to post
Share on other sites

no,. im a noob ok? -__- im having trouble just rtying to loop a variable $num= 0 and loop it until $num= 9 -____-

No... It's not ok... You've been a part of the forum for several months. You should know the first thing you would want to do before using a function is to 1. Look at what it does and 2. How to impliment it.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Agreed...

(Try doing string formats in Fortran!)

Share this post


Link to post
Share on other sites

Try doing string formats in Fortran!

Oh man, I just got a cold shiver down my spine.

Auto3Lib: A library of over 1200 functions for AutoIt

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