There is an issue with using the end keyword in gretl when specifying output buffers for the gnuplot command. The command fails to execute correctly when using S[end] as the output buffer.
Question: Is this actually a bug or some unconsidered special case?
clear
set verbose off
open denmark --quiet
# Test the "end" keyword
strings S = array(1)
print S[end] # WORKS: empty as expected
S[1] = "ABC"
print S[end] # WORKS: content as expected
gnuplot LRM LRY --with-lines --time-series --outbuf=S[1] # WORKS
gnuplot LRM LRY --with-lines --time-series --outbuf=S[end] # FAILS
The gnuplot command should successfully execute and use S[end] as the output buffer, similar to how it works with S[1].
Using S[end] as the output buffer in the gnuplot command results in a failure, while using S[1] works without issues.
This bug seems to indicate a problem with how the end keyword is handled in the context of output buffers for the gnuplot command. It would be beneficial to ensure that the end keyword can be used consistently across different commands.
Thank you!
In the option-string context we're not in full "genr" mode, and were expecting either a plain index number or an expression that yields an integer. However, "end" is now supported as a special case if we know the string in question is supposed to specify an array element.