Welcome to Roland Script

Roland Script (or Roland) is a DSL designed to be simple yet powerful. It is ideal for structured scripting with minimal syntax.


Basic Script Structure

ROLAND SCRIPT
hi roland.script! // Entry point of the script (MANDATORY)
END! // The word is not mandatory, but it's used to make the code clean at the end.
PASS! // Also, the word is not mandatory, but it is used to make the code clean in the end.

Variables - Integers

ROLAND SCRIPT
var = X; // Declare integer variable
X = 3; // Assign value
// Example:
var = Y;
Y = 10;

Variables - Decimals (Dnumber)

ROLAND SCRIPT
Dnumber = X; // Declare decimal variable
X = 3.4; // Assign decimal value
// Example:
Dnumber = Y;
Y = 5.7;

Variables - Characters

ROLAND SCRIPT
character = X; // Declare character variable (single letter)
X = e; // Assign character (no quotes)
// Example:
character = letter;
letter = A;

Variables - Words (Strings)

ROLAND SCRIPT
word = X; // Declare word variable
X = ammar; // Assign word (no quotes)
// Example:
word = name;
name = ahmed;

Variables - Boolean (TFvar)

ROLAND SCRIPT
TFvar = X; // Declare boolean variable (true/false)
X = true; // Assign true or false
// Example:
TFvar = isActive;
isActive = false;

Mutable Variables

ROLAND SCRIPT
X = 34; // It can be changed after appointment
// Example:
var = E;
E = 23;

Greet - Reserve a Name

ROLAND SCRIPT
greet name:("ali") // Reserve a name in the code
msg.log:("hello + name") // Use the reserved name
// Example:
greet username:("sara")
msg.log:("Welcome username")

Conditions (if)

ROLAND SCRIPT
var X = 3;
if var X = ("3")
msg.log:("Matched")

// Another example:
var Y = 400;
if var Y = ("400")
msg.log:("hello world!")

User Input (if typed & msg.out)

ROLAND SCRIPT
var X;
msg.out:("if typed 34 in X") // Receive user input
msg.log:("X = msg.out") // Print what user typed

// if typed example:
msg.out:("Enter number:")
if typed = ("34")
msg.log:("You typed 34")

Input & Output (msg.log & msg.out)

ROLAND SCRIPT
msg.log:("Hello World!") // Print output to console
msg.out:("Enter value") // Receive user input

Libraries (get lib)

ROLAND SCRIPT
get lib:("calculator") // Load calculator library (only library available)
msg.log:("2+43") // Compiler will show answer in console

Repeat / Reload (reload!)

ROLAND SCRIPT
msg.log:("hello world!")
reload! = ("19") // Repeat the previous command 19 times
// This will print "hello world!" 19 times

Comments (bookname)

ROLAND SCRIPT
bookname:("this code for calculator") // Add a comment
bookname:("code is here!")

Termination (PASS! & END!)

ROLAND SCRIPT
bookname:("code is here!")
msg.log:("hello world!")
PASS! // Final Termination

// END! example (Final exit like pass):
bookname:("code is here!")
msg.log:("hello world!")
END! Final exit like pass

Complete Examples

ROLAND SCRIPT - Basic Example
hi roland.script!
msg.log:("hello world!")
END!
ROLAND SCRIPT - Calculator Example
hi roland.script!
bookname:("Simple Calculator")
get lib:("calculator")
msg.log:("5+3")
PASS!
ROLAND SCRIPT - User Input Example
hi roland.script!
msg.out:("Enter your name:")
msg.log:("Hello msg.out")
END!
© Restudio Games