Scripting:Syntax

From STNE Wiki

(Difference between revisions)
Jump to: navigation, search
Glest Durnham (Talk | contribs)
(Created page with "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...")
Newer edit →

Revision as of 00:57, 15 August 2010

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