-
Notifications
You must be signed in to change notification settings - Fork 1
Rails
At the bottom of the page you can find an image of a simple script that utilizes most of the functions available at the moment, it may come in handy as a reference!
The file extension must be .rls
and the first line of the file must be [SCRIPT]
, otherwise it will not execute. If a line contains [END]
the script will exit at that line. All lines are scanned for keywords, variable names, and more and if nothing is matched, it is assumed the line contains a command from CMD++.
The character #
is used as a comment and cannot be used anywhere else. The interpreter will remove any text after it.
At the moment there is only one variable type which is NUM
. It is a floating-point variable that can be used as an integer or a float without any extra work. Simply use a .
when you need decimal numbers.
NUM number = 1
NUM decimal = 1.5
Variables can change values in a few different ways shown below:
number = 5
number = 5 * 5 / 2
number = number + 5
number++
number--
Currently, the only misc statement is print
, it will print all the text after it to the terminal. You can also use it to print the value of a NUM
variable by typing print number.value
.
print Printing Debug!
The label a is defined on the first line of this code block, and the goto is defined on the last, very simple. The scenario here would create an infinite loop.
label a:
#Do stuff here
#Do even more stuff here
goto a:
If statements are written as follows:
In the first line of the code, there may be two parts that are unfamiliar, CheckInput
and ?
. CheckInput
is basically a variable name for the if statement, it is used to pair the correct if statement
to the correct endif
statement. The ?
char is only a separator, everything on the right side of it is the actual statement to be checked. Finally, the endif
statement consists of two parts, the endif, and the variable name.
if CheckInput ? input < 6
ls
cd ..
endif CheckInput