GSL - The Gsharp Script Language

GSL is an interpreted programming language which can be used to control Gsharp and develop graphics applications. The Graph templates used by the Gsharp Web Edition examples are all written in GSL. GSL can be programmed using a text editor, or GSL can generated using the Gsharp Professional Edition. In order to create your own graph templates, you will need to know how to program GSL. The Gsharp Professional Edition comes with an interactive Script Builder tool.

For GSL programming please see The Gsharp Script Language. Another good source of GSL programming information is the collection of Gsharp examples. You will find GSL examples generated using the Gsharp Script Builder tool showing object creation and property setting, as well as programmed examples using more advanced program structure and flow control.

Here is an example of a Gsharp Script - framework.gsw:

 

#!/bin/GsharpWE

include "$UNIDIR/lib/libhtml.gsl";

#Step 1 - Echo Header
HTTPheader();

#Step 2 - Setup Variables

#Step 3 - Create Plot
HTMLstartcomment(1);
exec("$UNIDIR/example/Gsharp/samples/barcharts.gsl");

#Step 4 - Make Image
imgfile = "start"+getpid()+".gif";
make_image(708, 531, getenv("GsharpTmpFilesActualDir") + imgfile);
HTMLendcomment(1);

#Step 4b - If necessary make ImageMap

#Step 5 - Create HTML
HTMLheader(1, "My GsharpWE Plot", "AVS");
fwrite(1,"<CENTER>");
HTMLheading(1, 1, "My GsharpWE Plot");
HTMLrule(1,60);
HTMLimage(1, getenv("GsharpTmpFilesWebDir") + imgfile);
HTMLrule(1,60);

HTMLfooter(1);

Don't worry about understanding this yet - we'll look at it in more detail later.

Now carry on to Writing HTML from GSL