Am 22.10.22 um 09:52 schrieb Sven Schreiber:
Am 22.10.2022 um 02:21 schrieb Federico Fiorani:
> Dear all,
> Gretl on my Windows crashes running this script
>
> <hansl>
> strings s = null
> s += "text"
> s -= "text"
> </hansl>
>
> Does anyone have the same problem?
Here under Ubuntu using git version from 4 days ago or so, the following
does _not_ lead to a crash:
<hansl>
clear
set verbose off
print "Experiment 1"
strings S = defarray("a")
catch S -= "a"
print S
</hansl>
Yes, I see this, too - thanks for the report.
This crash must be fixed, of course, but using the "-=" operator for an
array is not supported, AFAIK.
I assumed the same, Sven. However, actually the -= operator works with
arrays:
<hansl>
clear
set verbose off
print "Experiment 1"
strings S = defarray("a")
catch S -= "a"
print S
print "Experiment 2"
strings S = defarray("a", "b")
catch S -= "a"
</hansl>
However, the following scenario leads to a crash:
<hansl>
clear
set verbose off
set assert stop
print "Experiment 3"
strings S = defarray("a", "b")
catch S -= "b"
assert($error == FALSE)
print S
</hansl>
Artur