Case is a keyword to make single-lined basic conditionals.
case <keyword> <condition> -> eval
Argument |
Definition |
Keyword |
Keyword for the case comparision |
Condition |
Variable or path used in the condition |
Eval |
A single command that will be executed if the case result is positive. |
Keyword |
Definition |
defined |
Used to check if a variable is defined |
undefined |
Used to check if a variable is not defined |
existent |
Used to check if a path exist in the os |
unexistent |
Used to check if a path doesnt exist in the os |
define main -> {
var example "Hi!"
case defined example -> print "Example is defined"
case undefined anotherExample -> print "anotherExample is undefined"
}
If is a keyword to make multi-lined conditionals.
if <keyword> <condition> -> {
}
Argument |
Definition |
Keyword |
Keyword for the case comparision |
Condition |
Variable, path or eval-case used as the condition |
Keyword |
Definition |
defined |
Used to check if a variable is defined |
undefined |
Used to check if a variable is not defined |
existent |
Used to check if a path exist in the os |
unexistent |
Used to check if a path doesnt exist in the os |
eval |
Used to evaluate and compare 2 conditions |
Eval-Keyword |
Definition |
equal |
== |
nequal |
!= |
lequal |
<= |
gequal |
>= |
less |
< |
greater |
> |
define main -> {
var v1 "Hi"
var v2 "Hi"
if defined v1 -> {
print "v1 is defined"
if eval v1 equal v2 -> {
print "v1 is the same as v2"
}
}
}