On Tue, 6 Feb 2024, Sven Schreiber wrote:
I'm not sure I understand the rationale for the error I'm
getting:
<hansl>
open denmark
function void sercheck(void)
series hey = normal()
print hey
delete hey # error "cannot delete variable in this context"
end function
sercheck()
</hansl>
The doc says that "delete" is only problematic in a loop, not in a
function per se -- but true enough, if I add the --force switch to
the delete command, then it does not complain anymore. So is this
just a missing piece of documentation? OTOH, deleting a locally
created series should not be a problem, should it?
The error message is actually "You cannot delete series in this
context". Deleting series is always something to be wary of, since
it can invalidate existing lists, either directly or by causing
other series to be renumbered. Since local series are automatically
deleted when a function exits there's little reason to mess with
deletion inside a function.
Oh, BTW, another error "on the road"; writing the function
signature
with " void" like this:
function void sercheck( void)
(with a blank), I'm getting another error, too. ("unrecognized type...")
That glitch is now fixed in git.
Allin