2019-09-21 14:56:06 +02:00
|
|
|
var i:=1;
|
|
|
|
|
while (++i<3)
|
|
|
|
|
print("while");
|
|
|
|
|
endwhile
|
|
|
|
|
print(i);
|
|
|
|
|
|
|
|
|
|
for (i:=1;i<3;++i)
|
|
|
|
|
print("for");
|
|
|
|
|
endfor
|
|
|
|
|
print(i);
|
|
|
|
|
print(++i);
|
|
|
|
|
|
|
|
|
|
i:=1;
|
|
|
|
|
function p(i)
|
|
|
|
|
print("in func after ++");
|
|
|
|
|
print(i);
|
|
|
|
|
++i;
|
|
|
|
|
endfunction
|
|
|
|
|
p(++i);
|
|
|
|
|
print("i after func call "+cstr(i));
|
|
|
|
|
|
|
|
|
|
i:=1;
|
|
|
|
|
function pp(byref i)
|
|
|
|
|
print("in func after ++");
|
|
|
|
|
print(i);
|
|
|
|
|
++i;
|
|
|
|
|
endfunction
|
|
|
|
|
pp(++i);
|
|
|
|
|
print("i after func call "+cstr(i));
|
|
|
|
|
|
|
|
|
|
var ii:=++i;
|
|
|
|
|
print(ii);
|
|
|
|
|
ii+=++i;
|
|
|
|
|
print(ii);
|
|
|
|
|
ii:=1+(++i);
|
|
|
|
|
print(ii);
|
|
|
|
|
|
|
|
|
|
var j:=3;
|
|
|
|
|
i:=2;
|
|
|
|
|
var b:=i+ ++j;
|
|
|
|
|
print(b);
|
|
|
|
|
|
|
|
|
|
var d:=1.5;
|
|
|
|
|
print(++d);
|
2019-09-21 16:19:19 +02:00
|
|
|
|
|
|
|
|
const c:=1;
|
|
|
|
|
++c;
|
|
|
|
|
print("should not change {}".format(c));
|
|
|
|
|
print("should change {}".format(++c));
|
2019-09-21 16:35:54 +02:00
|
|
|
|
|
|
|
|
var e:={1};
|
|
|
|
|
print(++e);
|
|
|
|
|
++e[1];
|
|
|
|
|
print(e);
|