Sign in to follow this  
Followers 0
djjones

How to generate four digit number?

3 posts in this topic

Hi all,

I've got some dumb newbie question:

need to generate four digit numbers counting from 0000 up to 9999.

Have no idea how to realize it.

So, please - if someone knows that - help me in.

Simon

Share this post


Link to post
Share on other sites



This is a good task for StringFormat:

$Start = 900
$Stop = 1000

$Length = 4

For $current = $Start To $Stop
    $formatted = StringFormat("%0"&Abs(Int($Length))&"d",$current)
    ConsoleWrite($formatted & @CRLF)
Next

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

Thank you ProgAndy - it rocks!

:) Liebe Grüße

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