Cast
| 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. |
xFloat = 2.61; xInt = Cast(xFloat, 1);
The value of xInt will be set to 2.