Skip to content

Syntax reference

José Manuel Nieto edited this page Nov 14, 2021 · 3 revisions

Comments

Comments, like in many other languages, are lines that start with a //

// This is a comment

Assignments

You can assign expressions to variables with the widely known syntax something = some_value;

a = "Hola, ¿cómo estás?";
b = 1;
c = 2;
c = a + b;

Procedures

You can create your own procedures with this syntax

MyProcedure
{
	<statements>
}

Conditional statements

They're the the classic if-else statements

if (condition)
{
    <statements>
}
else 
{
    <statements>
}

condition should evaluate to a boolean value

Function and procedure calls

You can call procedures and functions with this syntax:

Procedure(); //Procedures don't have parameters
Function(a, b, c);

String concatenation

You can concatenate strings with a special syntax

a = "hello"
b = "world";
c = "{a} {b}";  // c will be "Hello world"

This is also valid with variables that are not strings:

a = 123;
b = "Hello";
c = "{a}{b};   // c will be "Hello123"

Clone this wiki locally