Simple addition

Got a quick one for you all. I am trying to set up a counter in a session variable so that I know when the current page is less than the total pages. ("on page 3 of 16"). I can't get the script to add these as int.

if ( Integer.parseInt(session.getVariable("PAGE")) < Integer.parseInt(session.getVariable("TOTALPAGES")) ){
int thenextpage = Integer.parseInt(session.getVariable("PAGE")) + 1;
session.setVariable( "PAGE", thenextpage);
session.scrapeFile("search results");
}

thanks

Simple addition

Hi,

This might also be helpful to you

http//www.screen-scraper.com/support/docs/api_documentation.php#addToVariable

Kind regards,

Todd Wilson

got it

well, at least it works this way.

if ( Integer.parseInt(session.getVariable("PAGE")) < Integer.parseInt(session.getVariable("TOTALPAGES")) ){

addedvalues = Integer.parseInt(session.getVariable("PAGE")) + 1;

session.setVariable( "PAGE", Integer.toString(addedvalues) );

session.scrapeFile("search results");
}