Page 1 of 1

StrParse array and using Loop Counter

PostPosted: Tue Nov 01, 2016 9:58 pm
by agilefalcon
I am trying to loop through a list of files:
The list is determined using StrParse which populates an array based on the variable [FileName]. Thus it would be FileName1, FileName2, FileName3 etc.

In a Loop, I am using the loop's counter to identify the element in the array:
Loop "1" "[FileCount]" "[Counter]"
setvar "[FileName]" "[FileName]![Counter]"
.do my processing here and then reset the Filename for the next iteration.
setvar "[Filename]" ""
EndLoop

I have tried with and without the "!" but all I get is the counter number. If I use the actual variable [FileName1] the it works but of course I cannot auto increment the parsed elements.

What am I doing wrong?

Chris.

Re: StrParse array and using Loop Counter

PostPosted: Wed Nov 02, 2016 2:24 am
by Peter
setvar "[VarName]" "[FileName[Counter]]"

Re: StrParse array and using Loop Counter

PostPosted: Wed Nov 02, 2016 8:03 am
by agilefalcon
Sweet! Thank you for your help.

Chris