addToVariable (basic edition)

The organization that I volunteer for added some laptops last year, and at that time I upgraded to basic 5.5. But I've just come to run some scripts for them, and addToVariable is no longer in scope:

"The error message was: Exception (line 75): RevScript12: The "addToVariable" method is not available in this edition of screen-scraper.-- Method Invocation session.addToVariable"

That kind of makes things difficult for us, I see this occurred in 4.5 (?).
Is there any alternative incrementation function in basic? I can't see one :-(

thanks
J.

.

.

There's not a method, per se,

There's not a method, per se, but it can be replaced in a few lines of code:

var = session.getv("VARIABLE");
var++;
session.setv("VARIABLE", var);

thanks - can't use var++: in

thanks - can't use var++: in interpreted java (?), but finally got this to work:

session.setv( "VARIABLE", "0" );
session.setv( "var", new Integer(0) );

session.setv("var", Integer.valueOf(session.getVariable("VARIABLE") ) );
session.setv("var", new Integer(
(( Integer )session.getv( "var" )).intValue() + 1) );
session.setv("VARIABLE", String.valueOf(session.getv("var") ) );

Jonathan

I neglected to consider that

I neglected to consider that the variable would be a String. Another solution might be:

var = session.getv("VARIABLE");
if (var==null)
        var = 0;
else if (!(var instanceof Integer))
        var = Integer.parseInt(var);
var++;
session.log("New VARIABLE is " + var);
session.setv("VARIABLE", var);