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

Subst
Syntax
Subst(tbl_file, str_key);
tbl_file 
str_key 
Leading and trailing spaces are removed from the two strings on each line in the table. Strings that contain spaces must be enclosed in double quotes.
Description
Returns the first value (value column 0) in the specified substitution table entry.
Returns
Returns the first value (value column 0) of the entry specified by str_key. If the value does not exist, an empty string is returned.
Example
In this example, the following substitution table (author.tbl) is used.
//!CodePage UTF8!
//!multicolumn!
agatha christie  1890
alfred hitchcock 1899
The following script returns the first value from the entry with key agatha:
$surName = Subst("../data/tables/author.tbl","agatha");
When the script is run, the variable $surName gets the value "christie".
Notes
A substitution table is kept in memory until the script function EraseSubst is called for that table.
OpenText StreamServe 5.6 Updated: 2013-03-01