Jump to content

Recommended Posts

  • Moderators
Posted

Something like this (removed the msgboxes)?

$HowMany = 15
For $i = 1 To $HowMany Step 1
    If $i = 10 Then
        For $m = 10 To $HowMany Step 1
            ConsoleWrite($m & @CRLF)
        Next

        ExitLoop

    EndIf
Next

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted
10 minutes ago, youtuber said:

This operation cannot be done with single for?

Something like this maybe?

$HowMany = 15
$s = "Sample:"
For $i = 1 To $HowMany
    $s &= StringFormat(" %02i", $i)
Next
MsgBox(0,"",$s)

 

Posted (edited)

@TheXman 

Actually I use both examples above but I wonder if it is done with a single for loop?

I create as much txt file as the user wants, but I.

FileOpen($FOLDER & '\' & $TXTNAME & "-" & $s & ".txt", 1)
you Convert txt to : TXTNAME - 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15.txt
what I want is

TXTNAME-01.txt

TXTNAME-02.txt

...

and

TXTNAME-09.txt

TXTNAME-10.txt

...

Edited by youtuber
Posted (edited)

Unfortunately, I don't understand what you're asking.  You mean like this?

$HowMany = 15
For $i = 1 To $HowMany
    ConsoleWrite(StringFormat("%02i.txt", $i) & @CRLF)
Next

 

Edited by TheXman

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...