I have a question on how to program a loop where I can name objects at the same time I append the object to a spool object.
What I like to do is to plot many graphs at once (to check if my data look right).
So, I write a code as follows, according to a suggestion in this "programming" forum.
(Annual.wf1 is attached.)
Code: Select all
' Annual data for all countries available
wfopen "Annual.wf1"
pageselect Time_Series
spool graph_m
group g_m ???_m
for !i=1 to g_m.@count
%name = g_m.@seriesname(!i)
graph_m.append(name=%name) {%name}.line
next
graph_m.display
This line doesn't work well.
The resulting spool object successfully shows all graphs, but the names of the graphs are "untitled01", "untitled02", ... and so forth.
Note that the EViews help file says as follows.
(Index > s > Spool > naming objects by command)
So, "name=" option of Spool::append should work.Naming Objects
The default name of an object when it is inserted into a spool is UNTITLED followed by the next available number (e.g. UNTITLED03). When using the Spool::append or the Spool::insert procs may use the "name=" option to specify a name.
Could anyone tell me why my code above doesn't work?
Thank you very much for your time,
Futoshi
