Reference

Home > Documentation > Syntax


Objective

The language’s main goal is text output. Therefore many programming principles do not apply. For more sophisticated programming needs, managed .Net code can be executed within the script (see runcs or runvb).

 

Template Code vs Plain Text

Processing is much like ASP or PHP scripting where plain text is direct output and any text within tags is code used for controlling the logic.

Eg. This sample code looping through tables and columns within each table:

<<!for table tbl in sources.source1!>>
SELECT
  <<!for column col in tbl!>>
  <<!col!>>,
  <<!end!>>
FROM <<!tbl!>>
<<!end!>>

can return this output:

SELECT
  FirstName,
  LastName,
  Address1,
  Address2,
FROM Customer

The plain text outside of the <<! tags !>> are output as it is; ‘SELECT’, ‘FROM’, the comma, each appropriate line-feed.

 

Comments

Any text preceded with a double forward slash “//” on a line are ignored by the compiler. There is no support for multi-line commenting (such as a /* comment like this */).

 

Statement Separation

Statements are separated by a newline. To have more than one statement on a line, each statement can be separated by a semicolon “;”.

 

Variables and Typing

Variables are declared by using the set keyword. There is no explicit typing, variable types are determined dynamically. Additionally there are no classes, enumerations, etc. The system types provided are:

  • Numeric
  • String
  • Boolean
  • Source
    Model connection used by the for keyword.
  • Meta
    Model components (such as table or column) used by the for keyword.

 

Function Calls

There are no function calls, however templates can be treated as functions and are run by using call.

 

Scope

There is a simple variable scope concept, without any object oriented information hiding principles deliberately being used. There are no access modifiers such as public, private, friend, etc. Three different kinds of references have this behaviour.

  • Sources
    Sources have global exposure and can be called anywhere. A source connection is referenced by qualifying with the reserved word sources.
  • Templates
    Calls to templates are only accessible within its own package.
  • Variables
    Variables are visible only within the block construct it has been declared in. For instance a variable declared within a for loop (including the variable declared as the iterator), is not accessible outside of the block (after the end statement).