WeLang Documentation
Introduction
WeLang is a programming language designed for simplicity and ease of use. Below are some examples and descriptions of its features.
Comments
In WeLang, comments are created using the semicolon ;
. Comments are ignored during execution and are meant for providing explanations or notes within the code.
; This is a comment
; Another comment explaining variable declaration
Variable Declaration
Use var.create
to declare a new variable.
var.create myVar
Variable Definition and Setting
Variables can be set using var.set
followed by the variable name and value within single quotes.
var.set myVar = 'Hello'
Command Definition
You can define a command that targets a variable using !set command = 'commandName'
. This assigns the last declared variable to the command.
!set command = 'printVar'
Executing a Command
The !cr
command is used to execute a command, outputting the value of the variable assigned to this command.
!cr myVar
Data Manipulation
The mov
command sets an integer value to a variable, while add
increases it.
mov myVar, 10
add myVar, 5
Debugging and Modifiers
The mod
command can modify the debug mode. Using mod x023x
disables debug output.
mod x023x
Program Execution
Execution begins with start us:
and ends with stop us
. Use these to define the application's lifecycle.
start us:
!cr myVar
stop us