Change precedence of variable ranges

Ask for help about FlashGot, no registration needed to post
Post Reply
jrh5312
Posts: 1
Joined: Wed Jul 20, 2011 1:34 am

Change precedence of variable ranges

Post by jrh5312 »

In the build gallery of http://image.weather.com/images/maps/fo ... map_wkpln_[period([0-1])][1-10;1]_3uswc_enus_600x405.jpg with
var words=["day","night"];
return words[arguments[0]];

Is there an easy way to sequence the function period before the variable [1-10;1] so that I receive

day1.jpg
night1.jpg
day2.jpg
night2.jpg
day3.jpg
night3.jpg
...
day10.jpg
night10.jpg

instead of the current output:

day1.jpg
day2.jpg
day3.jpg
...
day10.jpg

then
night1.jpg
night2.jpg
night3.jpg
...
night10.jpg

Thank you for your help!
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.18) Gecko/20110614 Firefox/3.6.18 ( .NET CLR 3.5.30729; .NET4.0C)
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Change precedence of variable ranges

Post by Giorgio Maone »

No, because order usually does not matter if you aim to download everything.
However you could try something like

Code: Select all

[period([0-39])][halve([$0])]
where period() would be

Code: Select all

return ["day", "night"][arguments[0] % 2]
and halve() would be

Code: Select all

return Math.floor(arguments[0] / 2);
Notice that [$n] is a backreference to the nth range expression.
Mozilla/5.0 (Windows NT 5.2; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
Post Reply