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
|
|
|
|
begin
|
2019-11-18 19:10:48 +04:00
|
|
|
var result : int := 23 ;
|
2019-05-13 00:56:22 +04:00
|
|
|
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
|
|
|
|
begin
|
2019-11-18 19:10:48 +04:00
|
|
|
var x : int := 41 ;
|
2019-10-18 16:32:58 +04:00
|
|
|
x := 1 + (if b then x else main(x)) ;
|
2019-11-18 19:10:48 +04:00
|
|
|
end with x
|