On Sun, 20 Nov 2016, Sven Schreiber wrote:
Hi,
I don't think this is a new bug, but who knows, and anyway:
<hansl>
function scalar rc(void)
loop i=1..2
return i
endloop
end function
rc()
</hansl>
I get an error saying the function doesn't return the proper type.
If I replace "return i" with the two lines:
out = i
return out
then it works.
This is with the brand new 2016d.
I don't think this is new. The point is that if the index "i" is not
declared outside of the loop it is considered an automatic variable
which exists only for the scope of the loop. So you could get the
effect you expected by sticking in
scalar i
before the loop. (Then the function will return 1).
Allin