Enumerations of the Megaladata Built-in Entities
The enumerations describing the fields and variables metadata is built in within the JavaScript execution context.
Description of Enumerations
DataType
It represents data types. Enumeration items:
Item | Data type |
---|---|
None | No data type specified |
Boolean | Logical |
DateTime | Date/time |
Float | Real |
Integer | Integer |
String | String |
Variant | Variant |
DataKind
It represents data kinds. Enumeration items:
Item | Data kind |
---|---|
Undefined | No data kind defined |
Continuous | Continuous |
Discrete | Discrete |
UsageType
It represents usage type of fields. Enumeration items:
Item | Field usage type |
---|---|
Unspecified | No usage type specified |
Excluded | Excluded |
Useless | Useless |
Active | Active |
Predicted | Predicted |
Key | Key |
Group | Group |
Value | Value |
Transaction | Transaction |
Item | Item |
Examples of use:
import { OutputTable, DataType, UsageType } from "builtIn/Data";
let col0 = OutputTable.Columns[0];
// Assertion of the property value with the "enumeration" type
if (col0.DataType == DataType.String) {
// We are doing something
}
// Displaying of the numeric representation of the enumeration value
console.log(col0.DefaultUsageType);
// Displaying of the string representation of the enumeration value
console.log(UsageType[col0.DefaultUsageType]);