system.mes.util.isValidType
Description
Validates whether a value can be converted to the specified data type.
The dataType may be supplied as an Ignition
DataType
or as its String name (for example "Int4", "Float8", "Boolean", "DateTime", "ByteArray").
Syntax
system.mes.util.isValidType(value, dataType)
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
value | Object | False | The value to test. |
dataType | Object | False | The target data type, as an Ignition DataType or its String name (e.g. "Int4"). |
Returns
True if the value can be coerced to the given data type, otherwise False.
Code Examples
# Check whether the string "123" can be converted to an Int4
isValid = system.mes.util.isValidType(value="123", dataType="Int4")
print(isValid)