11.07.2015 Views

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

160 webMathematica User Guidetmp = Null;tmp = MSPToExpression[ $$expr] ;If[ tmp =!= Null,....]When the page is finished, tmp will be cleared.Session VariablesIf you want to save any values from one request to the next, you can use MSPSessionVariableto make a session variable. These will be stored in the server and can be used in pages that arepart of different requests. They use HTTP sessions and so the session variables for one user arenot visible to those of another user (just as the shopping cart at an e-commerce site is for oneuser and is not visible to another).In the code fragment below there are two variables; savedInput is a session variable, declaredwith MSPSessionVariable, while xInput is a page variable. In the second evaluation, if xInputhas a value, this is added to savedInput.MSPSessionVariable[ savedInput, {}];xInput = Null;xInput = MSPToExpression[ $$expr] ;If[ xInput =!= Null, savedInput = Append[ savedInput, xInput]];You can work with session variables in just the same way that you work with page variables;assigning them the results of calculations and then later retrieving them. The difference is thatsession variables last after the page is finished.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!