If your data has a missing value in the column strcol() is supposed to read, the returned value cannot be used with the "eq" string operator.
Example:
$dat << EOD
1 A B
2 B
3 A B
4 T H
5 A A
6 A B
EOD
plot $dat us 1 : (strcol(2) eq "A" ? 10 :-10) w lp # column 2 is fine, no problem
plot $dat us 1 : (strcol(3) eq "A" ? 10 :-10) w lp # col 3 has one value missing
internal error : STRING operator applied to undefined or non-STRING variable
I guess the return is undefined instead of a string with zero lenght (which I was expecting).
I found a workaround, concatenating strcol() to a zero lenght string:
~~~
plot $dat us 1 : ("".strcol(3) eq "A" ? 10 :-10) w lp` # Works
~~~
Now fixed in master and will be included in 6.0.6
Reopening this because the fix introduces another problem. Now strcol(N) on a missing column returns an empty string, but that string is never freed so it's a memory leak, albeit a small one.
Reopening this because the fix introduces another problem. Now strcol(N) on a missing column returns an empty string, but that string is never freed so it's a memory leak, albeit a small one.