2019-09-22 01:59:48 +04:00
|
|
|
// Test if conditional in PascaLIGO
|
|
|
|
|
2019-05-13 00:56:22 +04:00
|
|
|
function main (const i : int) : int is
|
|
|
|
var result : int := 23 ;
|
|
|
|
begin
|
|
|
|
if i = 2 then
|
|
|
|
result := 42
|
|
|
|
else
|
|
|
|
result := 0
|
|
|
|
end with result
|
2019-10-18 16:32:58 +04:00
|
|
|
|
|
|
|
function foo (const b : bool) : int is
|
|
|
|
var x : int := 41 ;
|
|
|
|
begin
|
|
|
|
x := 1 + (if b then x else main(x)) ;
|
|
|
|
end with x
|