Difference between revisions of "CustomColumnOption new"
Cg huyphong (talk | contribs) |
|||
Line 1: | Line 1: | ||
− | + | {{HelpFiles}} | |
− | {{HelpFiles}} | ||
− | ====CustomColumnOption_new==== | + | ==== CustomColumnOption_new ==== |
− | This function is the CustomColumnOption object's constructor and will return an array which must have 4 elements, configured like specified below: | + | 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. | + | *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_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_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. | + | *CUSTOM_COLUMN_OPTION_TEXT: The text of the custom column, it is the value of the argument text passed to the constructor function. |
− | '''Syntax''' | + | '''Syntax''' |
− | CustomColumnOption_new(''expression, value[, text]'') | + | CustomColumnOption_new(''expression, value[, text]'') |
− | '''Arguments''' | + | '''Arguments''' |
− | ''expression'': is a string. It must a boolean CG Script expression valid in the current DCS context. | + | ''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. | + | ''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. | + | ''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''' | + | '''Return type''' |
− | array | + | array |
− | '''Examples''' | + | '''Examples''' |
− | array customColumn = CustomColumn_new(CUSTOM_COLUMN_TYPE_NUMBER, "AgeGroup"); | + | ''array customColumn = CustomColumn_new(CUSTOM_COLUMN_TYPE_NUMBER, "AgeGroup");'' |
− | customColumn[CUSTOM_COLUMN_TEXT] = "Age groups"; | + | ''customColumn[CUSTOM_COLUMN_TEXT] = "Age groups";'' |
− | + | ''print(customColumn);'' | |
− | + | ''//Result: {2,1,AgeGroup,Age groups,{},}'' | |
− | '' | + | ''array columnOption = CustomColumnOption_new("Age == [18-45]", 1, "Adult");'' |
− | Version 5.5 | + | ''CustomColumn_addOption(customColumn, columnOption); '' |
− | __NOTOC__ | + | |
− | <!-- imported from file: 5437.htm--> | + | ''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 __NOTOC__ <!-- imported from file: 5437.htm--> | ||
+ | |||
+ | [[Category:Data_cache_modifying_CGScript_functions]] |
Latest revision as of 12:00, 23 December 2011
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