There are several examples included with this distribution. They are located in the examples sub-directory where you installed Simkin.
- HelloWorld - a very simple example that prints "Hello World"
- Scriptloader - a small C++ program that loads an XML or TreeNode file whose name appears on the command line, and runs a method called main within it.
There are 4 flavours of this application:
- Scriptloader_TreeNode - loads a TreeNode file
- ScriptLoader_Expat - loads an XML file using the Expat parser and Simkin DOM classes
- Scriptloader_Xerces - loads an XML file using the Xerces library
- Scriptloader_MSXML - loads an XML file using the Microsoft MSXML library
You can use this to run the following example scripts:
- Simple - shows some simple Simkin script
To run this, change to the examples\simple directory and type:
<path-to>Scriptloader Simple.xml
- FieldAccess - shows code accessing elements and sub-elements
To run this, change to the examples\fieldaccess directory and type:
<path-to>Scriptloader FieldAccess.xml
- Enumerate - shows code enumerating elements within an XML element
To run this, change to the examples\enumerate directory and type:
<path-to>Scriptloader Enumerate.xml
- Array - shows code using the array index operator to pull out children of an XML element
To run this, change to the examples\array directory and type:
<path-to>Scriptloader Array.xml
- Demo_Controller - shows how you can use Simkin within an XML file to construct "on-the-fly" dialog boxes.
This example uses Demo.xml to describe the dialog.
To run the example, change to the examples\demo_xml directory and type:
<path-to>Demo_XML Demo.xml
There are versions of this example using the other XML libraries:
- Demo_Controller - is the same example as above, but using the TreeNode file format.
This example uses Demo.s to describe the dialog.
To run the example, change to the examples\demo directory and type:
<path-to>Demo Demo.s
- Inherits - shows how you can extend the Simkin classes to provide an "inheritance" feature in your XML files.
Other files in this example are:
To run the example, change to the examples\inherits directory and type:
<path-to>Inherits child.xml
- DynamicTreeNode - shows how you can add fields to TreeNodes (and other objects) on-the-fly in your scripts. The object set up in the C++ is called by the script dynamic.dat.
- SimkinCGI - shows how you can execute Simkin script within a CGI program. The script is sent to the CGI program via form index.html.
You will need to place the CGI program in the approporiate location for your web server, and modify the URL within the form accordingly.