StrParse array and using Loop Counter

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Locked
User avatar
agilefalcon
Posts: 11
Joined: Sat Jan 06, 2007 7:47 pm
Contact:

StrParse array and using Loop Counter

Post 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.
Chris Berardi
Fort Worth, TX
User avatar
Peter
Posts: 30
Joined: Thu Sep 27, 2012 4:41 pm
Location: St.Petersburg, Russia
Contact:

Re: StrParse array and using Loop Counter

Post by Peter »

setvar "[VarName]" "[FileName[Counter]]"
User avatar
agilefalcon
Posts: 11
Joined: Sat Jan 06, 2007 7:47 pm
Contact:

Re: StrParse array and using Loop Counter

Post by agilefalcon »

Sweet! Thank you for your help.

Chris
Chris Berardi
Fort Worth, TX
Locked