Scripting:Syntax

From STNE Wiki

Revision as of 00:57, 15 August 2010 by Glest Durnham (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page describes the syntax of the STNE scripting engine.

Variable declaration

Variables are declared with the code 'Var [VarName] As VarType'. This is best illustrated with a small example:

Var WelcomeMessage As String; // Declares a variable named 'WelcomeMessage' of type String
Var DataTable As CTable;      // Declares a variable named 'DataTable' of type CTable


It is also possible to immediately assign a value when declaring variables:

Var WelcomeMessage As String = "Hello galaxy!"; // Declares a string and assigns it a value
Var DataTable      As CTable = New CTable();    // Declares a variable and assigns a newly created CTable to it
Var DataTable      As New CTable();             // Also declares a variable and assigns a newly created CTable to it, but with less code
Personal tools