Jump to content

Loop with multiple increment variables

Recommended Posts

#include <File.au3>
#include <Excel.au3>
#include <String.au3>
#include <MsgBoxConstants.au3>

Local $file = "TEST.log"
FileOpen($file, 0)
$TTLPax = 1

For $i = _FileCountLines($file) - $TTLPax to _FileCountLines($file)
    $line = FileReadLine($file, $i)
    Global $TktNo = StringMid($line, 8, 13) ; reads 13 characters from $Line starting from the 8th character
    msgbox(0,'',$TktNo) ; This is just for me to debug
        For $NoOfPax = 1 to 2
            local $TTLSeg = 2 
            msgbox(0,'',"7ABC"& $TktNo &"'N"& $NoOfPax &".1'C1,2'S1,2'B") ; This makes 7ABC1234567890123'N1.1'C1,2'S1,2'B 
                                                                          ;But in the next loop I want the value to be 7ABC1234567890333'N2.1'C1,2'S1,2'B

  2.TJ 1234567890123
  3.TJ 1234567890333

I am reading a file with last 5 lines as above. I want to be able to loop through and pick the values as follows

1- Pick 1234567890123

2- Use it to build a format with N1.1

3- Pick 1234567890333

2- Use it to build a format with N2.1

Need help with the loop. Thank You



Link to comment
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

  • Create New...