Script functions reference > Script functions in alphabetical order > G > GetSubst

GetSubst
Syntax
GetSubst(tbl_file, str_key, num_col);
tbl_file 
str_key 
num_col 
Description
Returns the value from the specified value column in the specified substitution table entry.
Returns
The value located in num_col of the entry specified by str_key.
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 second value from the entry with key agatha:
$born = GetSubst("../data/tables/author.tbl","agatha",1);
When the script is run, the variable $born gets the value 1890.
Notes
For backwards compatibility, Subst and SubstArr do not remember comments made in the substitution file. If you want WriteSubst to keep your comments, call GetSubst before any other substitution function accesses the substitution file.
When retrieving a specific value, the GetSubst function does not take the column separators (tab or space characters) into account. To make sure that the correct value is returned, you should use double quote ("") to indicate empty columns in the table. Otherwise, the next non-empty column will be returned.
OpenText StreamServe 5.6.2 Updated: 2018-01-26