|
From: Ethan M. <merritt@u.washington.edu> - 2010-01-04 07:40:12
|
On Sunday 03 January 2010, Tatsuro MATSUOKA wrote:
> Hello
>
> I have found 'stringvar.dem' fails at the current cvs version (Latest ChangeLog 2009-01-02)
>
>
> read_time(fmt, c) = strptime(fmt, stringcolumn(c).' '.stringcolumn(c+1))
> 01/06/93 0000 0.20 0.175 3.07 2.62 0 25 0.24 7.5 70.8
> 16.9 0.328 9.94 23.74 ...
> timedat.dat:1:"stringvar.dem", line 136: illegal day of month
My fault. I should have found that problem myself.
The demo is a very strange example of reading a date string without using the
built-in date handling procedure. Instead it reads the input as pure string data
and converts it to a time in seconds. The result is the same as if the data file
itself had contained the time in seconds, which could be read using timefmt "%s".
The idea of the demo was to show that we don't really need the command
"set xdata time" any more for input. And in fact the demo continues to work
for reading in the dates if you comment out "set xdata time". However, there
is a problem. The same command "set xdata time" is used to control both the
input and the output. If we turn it off for input, it also turns off the
use of time formats for output (axis labels).
There are two possible fixes
1) Change the way the demo works. It may be possible to bypass the built-in
time handling for output either. That would make the demo even more useful,
but I am not sure it is possible.
2) I will revise the new code in datafile.c so that it is not executed unless
the timefmt is "%s". This preserves the old behaviour of the demo,
while still achieving the intended new capability to handle
set timefmt "%s"
plot ... using ($1):2
> I have confirmed on cygwin and mingw.
>
> On djgpp, "stringvar.dem" crashes gnuplot.
I understand why there is currently an error message.
I do not understand why there would be a crash.
Please check again with the revised code.
Ethan
> Perhaps this is a side effect latest change,
>
> 2010-01-02 Ethan A Merritt <merritt@u.washington.edu>
>
> * src/datafile.c (df_readascii): Time format "%s" should be able to
> handle any numeric input. Convert input of the form 'using ($1)' or
> 'using (f($1))' to a string so that it can be passed to gstrptime().
> Bug #2899511
>
> Regards
>
> Tatsuro
> Regards
|