Hi!
I have the following issue, which can be bypassed in two ways but I just want to report it in case that it were a bug.
Consider this program:
program issue;
function suma:integer;
var num: integer;
begin
read(num);
if num = -1
then suma:=0
else suma:= num + suma;
end;
begin
writeln('enter a sequence of integer numbers ended by -1 ');
writeln('the sum is: ',suma);
readln;
end.
This program yields an erroneos result because it interprets that the identifier suma in the expression (recursive call) is a variable instead of the parameterless call.
Solution 1: call parameterless functions always with () for instance suma()
Solution 2: add {$mode tp}{$H-}{$X+}