The below code does not work. It only records 66 variables in 2 columns.
Code: Select all
NumberOfRecords = 177 ;number of records will change
loop %NumberOfRecords% ;this creates the variables for this example. I pull the variables from mulitiple locations
Var%a_index% = %a_index%
if NumberOfRecords > 33
{
loop 33 ;33 rows per page
{
;these 4 lines creates the variables for each row from my list of variables. Example row 1 on page 1 would be Var1 and Var34
tVar1++
tVar2 := (tVar1 + 33)
mVar1 := var%tVar1%
mVar2 := var%tVar2%
StringLen,Len,mVar1 ; These 5 lines are for proper spacing between columns
NumberOfSpaces := (43 - Len)
Spaces =
Loop %NumberOfSpaces%
Spaces := (Spaces a_space)
if tVar2 > %NumberOfRecords% ;allows the last page to have only 1 variable in the first column and no variable in the second column when the total number of records have been positioned
NewList := (Newlist "`n" mVar1 Spaces "|")
else
NewList := (Newlist "`n" mVar1 Spaces "|" a_space mVar2)
}
}
FileDelete,%a_temp%\NewList.txt
FileAppend,%NewList%,%a_temp%\NewList.txt
run notepad.exe %a_temp%\NewList.txt
ExitApp