Conditionals - IUrixl/Kova GitHub Wiki

Case

Case is a keyword to make single-lined basic conditionals.

Basic syntaxis

case <keyword> <condition> -> eval

Arguments

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

Example of use

define main -> {
	var example "Hi!"

	case defined example -> print "Example is defined"
	case undefined anotherExample -> print "anotherExample is undefined"
}

If

If is a keyword to make multi-lined conditionals.

Basic syntaxis

if <keyword> <condition> -> { 
}

Arguments

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 >

Example of use

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"
		}
	}
}
⚠️ **GitHub.com Fallback** ⚠️