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.

webMathematica User Guide 111Needs["Main`"];Needs["Main`SubUnit`"];Context[ MyFunction]If you have installed the application and run this script on your server, you should see Main`SubÖUnit` returned. This confirms that you have correctly loaded the function from the application.Similar issues apply if you use the Master mechanism to load packages. You will either requirea Needs statement for the individual contexts, or refer to the full context name of the symbols.Of course, the former makes the Master mechanism not useful. An example of using full contextsis shown below.Needs["Graphics`Master`"];color = Graphics`Color`Red Writing PackagesIf you write any significant amount of your own code, it is a good idea to write it as a Mathematicapackage and load it into webMathematica. This is particularly important for webMathematicasince you want to reduce the amount of Mathematica code that you have in your webMathematicapages. There are a number of references that help with the process of writing a package; forexample, the section Setting Up Mathematica Packages. Instructions on how to load the packageare given in the previous section; information on the location to place your package isgiven in the following section.If you do not use the Mathematica package format, but instead use global definitions for yourcode, then you will need to load it every time the script is accessed. This is because of thepostprocessing that takes place when a script is accessed. It is recommended that you placecode into a Mathematica package.

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

Saved successfully!

Ooh no, something went wrong!