Object Reference : Object View and Procedure Reference : Spool
  
 
insert
Insert objects into a spool.
Syntax
spool_name.insert(options) object_list
where object_list is a list of one or more objects to be inserted into the spool at the position specified in the options. If you do not specify a view for an object in the list, the default view will be used.
If neither a location nor an offset are specified in the options, the object will be inserted at the end of the spool.
Options
 
loc = arg
arg may be an integer position in the spool or the name of an existing object in the spool. The inserted object will be placed before or after arg, as specified by the offset option below. An object name must include its path if it is a child of another spool. For example, use “spool1/gr1” to specify a graph GR1 in spool SPOOL1.
offset = arg, (default= “before”)
arg indicates that the object should be inserted relative to the object specified in the “loc=” option above. arg may be “before” or “after” (default= “before”).
In addition, if the location specified by the “loc=” option corresponds to a spool object, arg may be “first” or “last”, where the object will be inserted as the first or last object in the spool object specified (default= “last”).
name=arg
Set the names of the objects in the spool. arg is a space delimited list of new names for the list of objects being added to the spool. If this UNTITLED01, UNTITLED02, etc.
mode=overwrite
Will remove any existing objects with the same name when used in conjunction with the name=arg option.
If neither a location nor an offset are specified, the object will be inserted at the end of the spool. If an offset is provided without a location, the object will be inserted relative to the main spool. Providing a location without an offset instructs EViews to insert the object at the location specified, pushing all objects proceeding and including object_name down the list of objects.
Examples
To insert a line graph view of the series SER1 as the last object in SPOOL01:
spool01.insert ser1.line
To insert TAB1 as the first object in SPOOL01:
spool01.insert(offset=first) tab1
Given a graph GR1,
spool01.insert(loc=gr1) tab1 tab2
inserts TAB1 in the current location of GR1 and TAB2 immediately following. All objects from GR1 onward are pushed down the list of objects.
Alternately, if SP1 is a spool object,
spool01.insert(loc=sp1,offset=last) ser1.line ser1.bar
inserts a line graph and bar graph view of series SER1 as the last objects in SP1. If “offset=last” is omitted, the objects will be inserted before SPOOL1.
To refer to a child object of a spool, you must specify the object’s path. For instance, given a spool SPOOL01 containing the spool SPOOL1, which in turn contains a graph G2:
spool01.insert(loc=sp1/g2) tab1
inserts TAB1 before graph G2 in spool SPOOL1, and moves the remaining objects down.
To replace a preexisting object X in SPOOL01 with the line graph view of series SER1:
spool01.insert(name=X, mode=overwrite) ser1.line
Cross-references
For additional discussion of spools see “Spool Objects”.
See also Spool::append and Spool::remove.