Contents - Index



The $SaveTable directive will save the contents of a specified table to a file after calculations are completed.  The $SaveTable directive has the following format:


$SaveTable 'TableName'  'FileName'  /A  /C1..10  /E  /F  /N  /R2..5  /T  /Q


'TableName' is a string constant or string variable with the name of the table that is to be saved.  The following are recognized table names






An EES file can have more than one Parametric, Lookup, Arrays or Integral table.  Each table appears with a separate tab in the window.  To specify which table to save, follow the table name with a colon and the name of the table as it appears on the tab of the window.  For example, to save the Parametric table named Table 1, TableName would be 'Parametric:Table 1'.  If no colon and name are provided the table that is foremost when the $SaveTable directive is executed will be saved. 


'FileName' is a string constant or string variable with the name of the disk file to which the table will be saved.  FileName should include a filename extension which can be one of the following types.

.LKT {EES lookup file format}  (.LKT64 is used for the 64-bit version)

.TXT {text file format}

.CSV {comma-separated values, recognized by EXCEL}

.DAT {tab-separated values, recognized by EXCEL}


The filename can include directory information.  If no directory is specified, the file will be saved in the current directory, which is usually the directory the EES file was read from.  Note that the name of the directory for the current EES file is available from the EESFILEDIR$ function.  The CONCAT$ function can be used with the EESFILEDIR$ function to create a complete path name to the directory for the current EES file.


If filename is a string constant equal to ? (without quotes)  then EES will display a standard save file dialog from which the name of the file can be selected.  That file name will then overwrite the ? so that the save file dialog does not reappear.   For example,


$SAVETABLE 'Arrays'  ?  


will save the data in the Arrays table into a file that is selected from the save file dialog.  The ? will be overwritten with the selected filename.  If ?? is provided, it will not be overwritten and the save file dialog will appear after every calculation.


The /A  /C  /E  /F  /N  /R  /T and /Q are optional parameters.  These parameters are not applicable for .LKT or .LKT64 files.


/A append to existing file. 


/C specify a range of columns, e.g., 1..10 that will be saved.   A string variable can be used to provide the range, e.g., /CC$ where C$ contains the range.  


/E save in EES format so that the file can be read directly by the EES Open Lookup Table command (applicable only for .TXT files)


/F         Normally, results are exported for each run in the Parametric table.  If the /F is present, only the results for the last run in the Parametric table will be exported.  This option is ignored if the calculations do not involve the Parametric table. 


/N include column name and unit information.  Use this parameter with the /E parameter to save the column name, units and format information from a Lookup file to a .txt file so that it can be read with the Open Lookup Table command or $OpenLookup directive.


/R specify a range of rows, e.g., 2..5 that will be saved.   A string variable can be used to provide the range, e.g., /RR$ where R$ contains the range.  


/T transpose rows and columns  (can not be used with /E option)


/Q do not surround strings with single quotes


The $SaveLookup directive provides many of the same capabilities, but only for Lookup tables. 


The $SAVETABLE directive should appear only in the main EES program.




{This example saves columns 2..4 and rows 2..4 of a Lookup table.  Three ways of specifying the columnn range are used.} 



Duplicate  i =1, 3




$savetable  'Lookup 1' file$[1] /CRange$ /Rrange$ 

$savetable  'Lookup 1' file$[2] /C'2..4' /Rrange$ 

$savetable  'Lookup 1' file$[3] /C1..4 /Rrange$