Script functions reference > Script functions in alphabetical order > C > ClearSubst

ClearSubst
Syntax
ClearSubst(tbl_file);
tbl_file 
Description
Clears the contents of the specified substitution table. It does not affect the physical file stored on disk, only the representation of the table in the memory.
The ClearSubst function is similar to EraseSubst:
ClearSubst clears the table contents but keeps the actual table in the memory.
EraseSubst removes the table from the memory.
If you experience performance problems when using substitution tables, you should use the EraseSubst function instead of ClearSubst. A substitution table is created in memory the first time it is used, and added to a global list of tables. The whole list must be searched to find the correct table, and if several tables are created for each job, the StreamServer will successively get slower if the tables are never removed from memory during the job.
If you use ClearSubst, and then access the substitution table with for example GetSubst, an empty string will be returned. If you access the table after using EraseSubst, the table will be re-read back from disk, and a value will be returned.
Returns
1
Example
In this example, the following substitution table (author.tbl) is used.
//!CodePage UTF8!
//!multicolumn!
agatha christie  1890
alfred hitchcock 1899
The following script clears the physical substitution table stored on disk (author.tbl):
ClearSubst ("../data/tables/author.tbl");
WriteSubst ("../data/tables/author.tbl");
OpenText StreamServe 5.6 Updated: 2013-03-01