Source language: Translate to:

StrParse array and using Loop Counter

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

StrParse array and using Loop Counter

Postby agilefalcon » Tue Nov 01, 2016 9:58 pm

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
agilefalcon
 
Posts: 9
Joined: Sat Jan 06, 2007 7:47 pm

Re: StrParse array and using Loop Counter

Postby Peter » Wed Nov 02, 2016 2:24 am

setvar "[VarName]" "[FileName[Counter]]"
User avatar
Peter
 
Posts: 29
Joined: Thu Sep 27, 2012 4:41 pm
Location: St.Petersburg, Russia

Re: StrParse array and using Loop Counter

Postby agilefalcon » Wed Nov 02, 2016 8:03 am

Sweet! Thank you for your help.

Chris
Chris Berardi
Fort Worth, TX
User avatar
agilefalcon
 
Posts: 9
Joined: Sat Jan 06, 2007 7:47 pm


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 0 guests

cron