Difference between revisions of "DCS addCustomColumn"

From Catglobe Wiki
Jump to: navigation, search
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
[[Category:Data cache modifying CGScript functions]]
+
{{HelpFiles}}

 
  
====DCS_addCustomColumn====
+
==== DCS_addCustomColumn ====
  
Adds the custom column passed as argument to the method.
+
Adds the custom column passed as argument to the method.  
  
The custom column is added to current data cache and a new axis with axis options, created based on the new column, is also added to the end of the axis-set. When the custom column is added a partial build will be triggered which will add the column to the current data cache.
+
The custom column is added to current data cache and a new axis with axis options, created based on the new column, is also added to the end of the axis-set. When the custom column is added a partial build will be triggered which will add the column to the current data cache.  
  
The function returns false if there is a column with the same name existing, returns true otherwise.
+
The function returns false if there is a column with the same name existing, returns true otherwise.  
  
'''Syntax'''
+
'''Syntax'''  
  
DCS_addCustomColumn(''customColumn'')
+
DCS_addCustomColumn(''customColumn'')  
  
'''Arguments'''
+
'''Arguments'''  
  
''customColumn'': Is an array. It is the custom column created by CustomColumn_new function.
+
''customColumn'': Is an array. It is the custom column created by CustomColumn_new function.  
  
'''Return type'''
+
'''Return type'''  
  
bool
+
bool  
  
'''Examples'''
+
'''Examples'''  
  
DCS_addCustomColumn(myCustomColumn);
+
''array customColumn = CustomColumn_new(CUSTOM_COLUMN_TYPE_NUMBER, "AgeGroup");''
  
'''Availability'''
+
''customColumn[CUSTOM_COLUMN_TEXT] = "Age groups";''
  
Version 5.5
+
''array customColumnOption_Kid = CustomColumnOption_new("Age < 15", 1, "Kid");''
__NOTOC__
+
 
<!-- imported from file: 5218.htm-->
+
''array customColumnOption_Teen = CustomColumnOption_new("Age == [15-18]", 2, "Teen");''
 +
 
 +
''array customColumnOption_Adult = CustomColumnOption_new("Age == [19-45]", 3, "Adult");''
 +
 
 +
''array customColumnOption_Senior = CustomColumnOption_new("Age > 45", 4, "Senior");''
 +
 
 +
''CustomColumn_addOption(customColumn, customColumnOption_Kid );''
 +
 
 +
''CustomColumn_addOption(customColumn, customColumnOption_Teen);''
 +
 
 +
''CustomColumn_addOption(customColumn, customColumnOption_Adult);''
 +
 
 +
''CustomColumn_addOption(customColumn, customColumnOption_Senior);''
 +
 
 +
''bool b = DCS_addCustomColumn(customColumn); ''
 +
 
 +
''if (b) print("Custom column was added.");''
 +
 
 +
''else print("Custom column was not added.");''
 +
 
 +
''//Result: Custom column was added.''
 +
 
 +
'''Availability'''
 +
 
 +
Version 5.5 __NOTOC__ <!-- imported from file: 5218.htm-->  
 +
 
 +
[[Category:Data_cache_modifying_CGScript_functions]]

Latest revision as of 13:14, 23 December 2011



DCS_addCustomColumn

Adds the custom column passed as argument to the method.

The custom column is added to current data cache and a new axis with axis options, created based on the new column, is also added to the end of the axis-set. When the custom column is added a partial build will be triggered which will add the column to the current data cache.

The function returns false if there is a column with the same name existing, returns true otherwise.

Syntax

DCS_addCustomColumn(customColumn)

Arguments

customColumn: Is an array. It is the custom column created by CustomColumn_new function.

Return type

bool

Examples

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

customColumn[CUSTOM_COLUMN_TEXT] = "Age groups";

array customColumnOption_Kid = CustomColumnOption_new("Age < 15", 1, "Kid");

array customColumnOption_Teen = CustomColumnOption_new("Age == [15-18]", 2, "Teen");

array customColumnOption_Adult = CustomColumnOption_new("Age == [19-45]", 3, "Adult");

array customColumnOption_Senior = CustomColumnOption_new("Age > 45", 4, "Senior");

CustomColumn_addOption(customColumn, customColumnOption_Kid );

CustomColumn_addOption(customColumn, customColumnOption_Teen);

CustomColumn_addOption(customColumn, customColumnOption_Adult);

CustomColumn_addOption(customColumn, customColumnOption_Senior);

bool b = DCS_addCustomColumn(customColumn);

if (b) print("Custom column was added.");

else print("Custom column was not added.");

//Result: Custom column was added.

Availability

Version 5.5