Difference between revisions of "CustomColumn new"
Cg huyphong (talk | contribs) |
|||
Line 1: | Line 1: | ||
− | + | {{HelpFiles}} | |
− | {{HelpFiles}} | ||
− | ====CustomColumn_new==== | + | ==== CustomColumn_new ==== |
− | This function is the CustomColumn object's constructor and will return an array which must have 5 elements, configured like specified below: | + | This function is the CustomColumn object's constructor and will return an array which must have 5 elements, configured like specified below: |
− | * OBJECT_TYPE: Object type information which should have the same value as TYPE_CUSTOM_COLUMN constant. | + | *OBJECT_TYPE: Object type information which should have the same value as TYPE_CUSTOM_COLUMN constant. |
− | * CUSTOM_COLUMN_DATA_TYPE: The type of the custom column, it is the value of the argument dataType passed to the constructor function. | + | *CUSTOM_COLUMN_DATA_TYPE: The type of the custom column, it is the value of the argument dataType passed to the constructor function. |
− | * CUSTOM_COLUMN_NAME: The name of the custom column, it is the value of the argument name passed to the constructor function. | + | *CUSTOM_COLUMN_NAME: The name of the custom column, it is the value of the argument name passed to the constructor function. |
− | * CUSTOM_COLUMN_TEXT: The text which will be used for the axis created when the column is added to the DCS in the current context. It has "" as the initial value. | + | *CUSTOM_COLUMN_TEXT: The text which will be used for the axis created when the column is added to the DCS in the current context. It has "" as the initial value. |
− | * CUSTOM_COLUMN_OPTIONS: The array of custom column options, it is initialized as an array with no elements. | + | *CUSTOM_COLUMN_OPTIONS: The array of custom column options, it is initialized as an array with no elements. |
− | '''Syntax''' | + | '''Syntax''' |
− | CustomColumn_new(''dataType, name'') | + | CustomColumn_new(''dataType, name'') |
− | '''Arguments''' | + | '''Arguments''' |
− | ''dataType'': is a number. It is the custom column's data type, it must have one of the following values. | + | ''dataType'': is a number. It is the custom column's data type, it must have one of the following values. |
− | * CUSTOM_COLUMN_TYPE_NUMBER | + | *CUSTOM_COLUMN_TYPE_NUMBER |
− | * CUSTOM_COLUMN_TYPE_BOOLEAN | + | *CUSTOM_COLUMN_TYPE_BOOLEAN |
− | * CUSTOM_COLUMN_TYPE_STRING | + | *CUSTOM_COLUMN_TYPE_STRING |
− | ''name'': is a string expression. It is the custom column's name, which must follow the DCS column name format. | + | ''name'': is a string expression. It is the custom column's name, which must follow the DCS column name format. |
− | '''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);'' |
− | Version 5.5 | + | ''//Result: {2,1,AgeGroup,Age groups,{},}'' |
− | __NOTOC__ | + | |
− | <!-- imported from file: 5436.htm--> | + | '''Availability''' |
+ | |||
+ | Version 5.5 __NOTOC__ <!-- imported from file: 5436.htm--> | ||
+ | |||
+ | [[Category:Data_cache_modifying_CGScript_functions]] |
Latest revision as of 11:30, 23 December 2011
CustomColumn_new
This function is the CustomColumn object's constructor and will return an array which must have 5 elements, configured like specified below:
- OBJECT_TYPE: Object type information which should have the same value as TYPE_CUSTOM_COLUMN constant.
- CUSTOM_COLUMN_DATA_TYPE: The type of the custom column, it is the value of the argument dataType passed to the constructor function.
- CUSTOM_COLUMN_NAME: The name of the custom column, it is the value of the argument name passed to the constructor function.
- CUSTOM_COLUMN_TEXT: The text which will be used for the axis created when the column is added to the DCS in the current context. It has "" as the initial value.
- CUSTOM_COLUMN_OPTIONS: The array of custom column options, it is initialized as an array with no elements.
Syntax
CustomColumn_new(dataType, name)
Arguments
dataType: is a number. It is the custom column's data type, it must have one of the following values.
- CUSTOM_COLUMN_TYPE_NUMBER
- CUSTOM_COLUMN_TYPE_BOOLEAN
- CUSTOM_COLUMN_TYPE_STRING
name: is a string expression. It is the custom column's name, which must follow the DCS column name format.
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,{},}
Availability
Version 5.5