Expressions can be used to display calculated text as well as numeric values. For example, you might use the Concat() function to join the value of a tag or the result of a calculation to a sentence.
A few of the string handling functions in VTS are as follows. Please refer to the VTS Programmer’s Guide, String and Buffer Functions for complete descriptions of these and other functions. (Note: many string functions cannot be used in Steady State, and thus cannot be used in an expression.)
Concat(a, b, c…) Concatenates any number of sub-strings into one sentence.
Concat(“Level of Tank 1: “,variable(“TankLevel_1”)\value, “%”)
Returns (for example): “Level of Tank 1: 30.35552%”
Concat(“Currently Viewing Station: “, StationNumber)
Example shows how to set the title of a parameterized page, where StationNumber is a text or numeric parameter of that page.
Format(width, precision, value) Turns a numeric value into a text string, having the specified width and precision (number of decimal points).
Format(5, 2, variable(“TankLevel_1”)]value)
Returns (for example): “30.36”
Replace(sentence, start, length, find, replace) Searches the sentence, starting at the Start character and continuing for Length characters, looking for every instance of Find and replacing it with Replace. Note that character counting begins with 0.
Replace("This is good", 1, 12, "is", "was")
Returns: “Thwas was good”
(Note that every instance of “is” is replaced. This may have unintended consequences.)
SubStr(sentence, start, length) Returns a substring of Sentence, beginning with the Start character and running for Length characters.
SubStr(“on a Halifax pier”, 5, 7)
Returns: “Halifax”