why wont my variable increase?

hi I have the following script which needs to increase the nextpage variable from 2 to 10. However the script never seems to increase and the scrape session runs continously.

//Create the loop to go from 2 to 10.
NEXTPAGE.clear();
for (int i=2; i<=10; i++)
{
// Make the current number available to the session.
session.setVariable("NEXTPAGE", String.valueOf(i));

// This line will just write an output to the log, but is otherwise unneeded.
session.log(" ***Starting PAGE COUNT " + session.getVariable("NEXTPAGE");

// Finally scrape the file for this CATID.
session.scrapeFile("collect video");
}

it may be that I set the nextpage variable on initially running the scrape to 0 and it appears that I cant reset this?

Or is it that because the script calls a scrapable file that call another scrapeable file before going back to the script?

Please Help!

thanks

why wont my variable increase?

My apologies about the link not translating right. I've fixed it for our future readers.

[url]http://www.screen-scraper.com/xfer/collect-video-test_Scraping-Session.zip[/url]

-Scott

why wont my variable increase?

tis ok I have managed to download it - thanks again!

why wont my variable increase?

Hi Scott, thanks for your reply and feedback.

the link does not appear to work?

Kerri

Re: why wont my variable increase?

kerrid,

For the most part it looks ok. I made these two modifications and it worked as expected for me.

Attempting to clear the NEXTPAGE variable is unnecessary since it gets set explicitly in the for loop.

[quote="kerrid"]
NEXTPAGE.clear();
for (int i=2; i<=10; i++)
[/quote]

You're missing a closing parenthesis in this log entry.

[quote="kerrid"]
session.log(" ***Starting PAGE COUNT " + session.getVariable("NEXTPAGE");
[/quote]

You can download the test session I created here.

[url]http://www.screen-scraper.com/xfer/collect-video-test_Scraping-Session.zip[/url]

Please let me know if you're still having issues.

Thanks,
Scott