Skip to content

Latest commit

 

History

History
78 lines (65 loc) · 1.88 KB

README-FlowControl-Conditions.md

File metadata and controls

78 lines (65 loc) · 1.88 KB

LOGO

1. Flow control - if, elseif and else

If, elseif and else are flow control methods. Please see the usage below.

1.1. If

See an example of if:

...
	$i = 1
	if ($i == 1)
		console.printLine("i -> 1")
	end
...

1.2. If and else

See an example of if and else:

...
	$i = 2
	if ($i == 1)
		console.printLine("i -> 1")
	else
		console.printLine("else: ", $i)
	end
...

1.3. If, elseif and else

See an example of if, elseif and else:

...
	$i = 2
	console.printLine($i, ":")
	if ($i == 0)
		console.printLine("i -> 0")
	elseif ($i == 1)
		console.printLine("i -> 1")
	elseif ($i == 2)
		console.printLine("i -> 2")
	elseif ($i == 3)
		console.printLine("i -> 3")
	else
		console.printLine("else: ", $i)
	end
...

2. Links

2.1. Language documentation

2.2. Other links