Enumerations of Built-In Megaladata Entities

The JavaScript code execution context provides built-in enumerations describing the metadata of fields and variables.

Description of enumerations

DataType

Represents Megaladata data types. Includes the following items:

Item Value Data type
None 0 No data type specified
Boolean 1 Logical
DateTime 2 Date/time
Float 3 Real
Integer 4 Integer
String 5 String
Variant 6 Variant

DataKind

Represents Megaladata data kinds. Includes the following items:

Item Value Data kind
Undefined 0 No data kind defined
Continuous 1 Continuous
Discrete 2 Discrete

UsageType

Represents Megaladata field usage types. Includes the following items:

Item Value Field usage type
Unspecified 0 No usage type specified
Excluded 1 Excluded
Useless 2 Useless
Active 3 Active
Predicted 4 Predicted
Key 5 Key
Group 6 Group
Value 7 Value
Transaction 8 Transaction
Item 9 Item

Examples:

import { OutputTable, DataType, UsageType } from "builtIn/Data";

let col0 = OutputTable.Columns[0];
// Checking the value of an "enumeration" property
if (col0.DataType == DataType.String) {
    // Necessary operations
}

// Ouputting a numeric representation of the enumeration value
console.log(col0.DefaultUsageType);
// Outputting a string representation of the enumeration value
console.log(UsageType[col0.DefaultUsageType]);

Read on: JS Calculator Functions

results matching ""

    No results matching ""