CustomColumnOption new

From Catglobe Wiki
Jump to: navigation, search



CustomColumnOption_new

This function is the CustomColumnOption object's constructor and will return an array which must have 4 elements, configured like specified below:

  • OBJECT_TYPE: Object type information which should have the same value as TYPE_CUSTOM_COLUMN_OPTION constant.
  • CUSTOM_COLUMN_OPTION_EXPRESSION: The expression for the custom column option, it is the value of the argument expression passed to the constructor function. The expression must be a CG Script expression valid in the current DCS context.
  • CUSTOM_COLUMN_OPTION_VALUE: The value of the custom column, it is the value of the argument value passed to the constructor function.
  • CUSTOM_COLUMN_OPTION_TEXT: The text of the custom column, it is the value of the argument text passed to the constructor function.

Syntax

CustomColumnOption_new(expression, value[, text])

Arguments

expression: is a string. It must a boolean CG Script expression valid in the current DCS context.

value: is an expression of type number, string or bool . It must have the same data type as the custom column's type, to which the current column option will be added.

text: is a string expression. It is the text used for generating axis option text when the custom column is added to the DCS. This is an optional argument.

Return type

array

Examples

array customColumn = CustomColumn_new(CUSTOM_COLUMN_TYPE_NUMBER, "AgeGroup");

customColumn[CUSTOM_COLUMN_TEXT] = "Age groups";

print(customColumn);

//Result: {2,1,AgeGroup,Age groups,{},}

array columnOption = CustomColumnOption_new("Age == [18-45]", 1, "Adult");

CustomColumn_addOption(customColumn, columnOption);

print(columnOption);

//Result: {3,Age == [18-45],1,Adult}

print(customColumn);

//Result: {2,1,AgeGroup,Age groups,{{3,Age == [18-45],1,Adult}},}

Availability

Version 5.5