On Wed, 14 Oct 2015, Sven Schreiber wrote:
Hi,
it wasn't easy hunting this one down in the sense of provoking the error
in a small (probably not minimal) example:
<hansl>
open denmark
function scalar heyhey (list in)
var 20 in # 20 is too much -> error
return 3
end function
if 5 < 10
list lulu = LRM LRY IBO IDE
catch scalar what = heyhey(lulu)
if $error
print "aha"
endif
endif
</hansl>
When I run this under Sep 20th's snapshot I get an error telling me I
have an unmatched "endif" ('ungepaartes "endif"' in German),
which I
think is quite obviously not true.
I also would be grateful for any hints about workarounds, because I want
to use the real-world version of this type of code on a remote machine
where I cannot update the gretl version myself.
Figuring out exactly what's going wrong here, with regard to the
error message, may take a while, but a workaround is easy. Here's a
revised script:
<hansl>
open denmark
function scalar heyhey (list in)
catch var 20 in # 20 is too much -> error
if $error
return 1
else
return 0
endif
end function
if 5 < 10
list lulu = LRM LRY IBO IDE
scalar err = heyhey(lulu)
if err
print "function heyhey produced an error"
else
print "function heyhey went OK"
endif
endif
</hansl>
Allin