Method and Field Names in Simkin Scripts


XML Version

Methods are defined using the function tag. The name of a method is defined as the value of the name attribute of the function element. The name must follow the rules allowed for the values of attributes.

Field names are specified as elements with tags, their names depend on the document's rules for tag names.

For example:

<object>
 <field>
  <value name="Name"/>
 </field>
  <function name="function" params="a,b">
   trace(a # b # field.value:name);
 </function>
</object>

TreeNode Version

Methods are defined using the usual TreeNode syntax. The method name is the label for a TreeNode item, and the code is contained within the data for the item.

Other nodes within the same TreeNode are accessible via their label names.

For example:

{
 field {
  value {
   name [Name]
  }
 }
 function [(a,b){
  trace(a # b # field.value.name);
 }]
}