mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
24 lines
369 B
Text
24 lines
369 B
Text
// Scope04 - make sure locals in sub-blocks can override other locals
|
|
//
|
|
var a array;
|
|
a[1] := 4;
|
|
a[2] := 5;
|
|
a[3] := 9;
|
|
|
|
function foo( a )
|
|
var i := 45;
|
|
|
|
foreach i in (a)
|
|
print("I="+i);
|
|
i := i + 1;
|
|
endforeach
|
|
|
|
print( "i=" + i );
|
|
|
|
print( "second pass" );
|
|
foreach i in (a)
|
|
print("I="+i);
|
|
endforeach
|
|
endfunction
|
|
|
|
foo(a);
|