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 3 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
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
- 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