Glich - v0.3.0 Manual
Statements
Home Development v0.3.0 Manual Glich Script Statements

Language Statements

A script consists of one or more statements. Some of these statements may include one or more sub-statements. The base language statements are as follows:-

Statement List
StatementUseExample
callRun a predefined command.call bold_write("Hello");
commandDefine a Command which can be called later.command bold_write( mess ) { write "<b>" + mess + "</b>"; }
constantCreate a constant value.constant tau = pi * 2;
doLoop through a script until a condition is met.do while y <= 2015 write "1 Jan " + y nl; y += 1; loop
endStop running a script, command or function.end;
fileDefine a file object for input and output.file test append "text.txt";
functionDefine a Function which can be used in an expression.function double( x ) { result = x * 2; }
globalInitialise or change a global variable.global paper = "A4";
ifRun code depending on condition.if value = 10 write "<b>" + value + "</b>"; else write value; endif
letInitialise or change a local variable.let d = 1;
markSet a named mark in the script.mark "test1";
objectDefine an Object for later use.object pair { values first second; function sum { result = first + second; } }
setSet a global default setting.set context hics;
writeCreate output.write value1, value2 nl;
writelnCreate output, followed by a new line.writeln.fname "Date: " + today_str;

This list may be extended by adding language extensions, such as Hics the calendar scheme extension.

Home Development v0.3.0 Manual Glich Script Statements

Managed by WebPageLayout Validated by HTML Validator (based on Tidy)

21st September 2024