From: Ethan A M. <merritt@u.washington.edu> - 2004-07-18 17:52:10
|
On Sunday 18 July 2004 07:03 am, Hans-Bernhard Broeker wrote: > > 3) user-defined string-valued functions. > > Users will almost certainly want to be able to do something like this: > > filename(i)=sprintf("foobar%d.ps", i) > > i=15 > > # in a loaded file: > set output filename(i) > plot something > i=i+1 > reread But that example does not require a user-defined function. That is the behaviour you would get anyway, courtesy of the automagic string evaluation code already written. filename = 'sprintf("foobar%d.ps",i)' set output filename i = 15 replot i = 16 replot What it does require (and your user-defined function would also require) is that term.c:term_set_output() and a few other places in the actual drivers be modified similarly to what I did for write_multiline(). They would need to check that the string is not really a constant, but instead holds a sprintf() command. 'set output <bar>' is messy because <foo> is used for something other than being printed. Most of the other 'set <foo> "string const"' require no special modification, since the fancy stuff happens inside the eventual print routine. -- Ethan A Merritt Department of Biochemistry & Biomolecular Structure Center University of Washington, Seattle |