Script functions reference > Script functions in alphabetical order > S > SetSubst

SetSubst
Syntax
SetSubst(tbl_file, str_key, num_col, str_value);
tbl_file 
str_key 
num_col 
str_value 
Description
Assigns str_value to the value column num_col of the specified substitution table entry. It does not affect the physical file stored on disk, only the representation of the table in the memory.
The substitution table file is specified by tbl_file, and the substitution table entry is specified by str_key. If the entry does not exist, it will be created.
Returns
N/A
Example
In this example, the following substitution table (author.tbl) is used.
//!CodePage UTF8!
//!multicolumn!
agatha christie   1890
alfred h          1899
The following script modifies the substitution table entry alfred, and adds the substitution table entry astrid:
SetSubst("../data/tables/author.tbl","alfred",0,"hitchcock");
SetSubst("../data/tables/author.tbl","astrid",0,"lindgren");
SetSubst("../data/tables/author.tbl","astrid",1,"1907");
WriteSubst("../data/tables/author.tbl");
After the script is executed, author.tbl is changed as follows:
//!CodePage UTF8!
//!multicolumn!
agatha christie    1890
alfred hitchcock   1899
astrid lindgren    1907
Notes
Try to use the AddSubst function instead of SetSubst when possible, as more than one job can be executed at the same time. If different jobs call SetSubst, they will overwrite each others’ modifications to the substitution table.
OpenText StreamServe 5.6 Updated: 2013-03-01