AddSubst(tbl_file, str_key, num_col, str_value);
tbl_file
str_key
num_col
str_value
A string representing a numeric value to add to the value found in column num_col. The number may be given with or without a decimal point. The function rounds the value to the maximum number of decimals given previously or in this parameter. You can use a negative number to subtract.Adds str_value to the value in 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 key or column does not exist, it will be added.Returns the sum of the old value retrieved from the substitution table, and the value given in str_value.In this examples, the following substitution table (author.tbl) is used.
//!CodePage UTF8!//!multicolumn!agatha christie 1890alfred hitchcock 1899
Example 50 In the following script, the variable $century gets the value 1899 + 100.$century = AddSubst("../data/tables/author.tbl","alfred",1,"100");
Example 51 SetSubst("../data/tables/author.tbl","astrid",0,"lindgren");AddSubst("../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 1890alfred hitchcock 1899astrid lindgren 1907
• 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 |