Cast
(Engine-Level Function)
Description | Takes a value and returns a different type of value, if possible. |
Returns | Numeric |
Usage | Script or steady state. |
Function Groups | Compilation and On-Line Modifications, Variable |
Related to: | |
Format | Cast(Val, Type) |
Parameters |
Val |
Required. Any variable name. |
Type |
Required. A VTScada Value Types indicating what type of value should be returned. |
Comments | This function performs a type-cast, changing one type of value to another. Note that values that are converted to integers are truncated, rather than rounded. If a stream longer than 65,523 characters is cast to a text string, it will be truncated at 65,523 characters. |
VarFloat = 2.61; VarInt = Cast(VarFloat, 1);
The value of VarInt will be set to 2.