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

GetSubstKey
Syntax
GetSubstKey(tbl_file, num_key_index);
tbl_file
num_key_index
A number specifying the index of the entry key to return (i.e. a row in the substitution table). The first key index is 0.
Description
Returns a key from a substitution table.
Returns
The entry key with index (i.e. row) num_key_index. If the entry was not found, 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 entry keys for the two first entries in the substitution table:
$name1 = GetSubstKey("../data/tables/author.tbl",0);
$name2 = GetSubstKey("../data/tables/author.tbl",1);
When the script is run, $name1 and $name2 gets the following values:
$name1 = "agatha"
$name2 = "alfred"
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.
OpenText StreamServe 5.6 Updated: 2013-03-01