Toggle menu
862
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

DCS getCustomColumn: Difference between revisions

From Catglobe Wiki
Cg_pham (talk | contribs)
No edit summary
Cg van (talk | contribs)
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
[[Category:Data cache modifying CGScript functions]]
[[Category:Data cache modifying CGScript functions]]

{{HelpFiles}}


====DCS_getCustomColumn====
====DCS_getCustomColumn====
Line 20: Line 20:
'''Examples'''
'''Examples'''


array myCustomColumn = DCS_getCustomColumn("AgeGroup");
''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.''
 
''array myCustomColumn = DCS_getCustomColumn("AgeGroup"); ''
 
''print(myCustomColumn);''
 
''//Result: {2,1,AgeGroup,Age groups,{{3,Age < 15,1,Kid},{3,Age == [15-18],2,Teen},{3,Age == [19-45],3,Adult},{3,Age > 45,4,Senior}},} ''


'''Availability'''
'''Availability'''

Latest revision as of 06:54, 26 December 2011



DCS_getCustomColumn

Gets the custom column with the name passed as argument to the function.

Syntax

DCS_getCustomColumn(name)

Arguments

name: Is a string expression. This is the custom column's name.

Return type

Array

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.

array myCustomColumn = DCS_getCustomColumn("AgeGroup");

print(myCustomColumn);

//Result: {2,1,AgeGroup,Age groups,{{3,Age < 15,1,Kid},{3,Age == [15-18],2,Teen},{3,Age == [19-45],3,Adult},{3,Age > 45,4,Senior}},}

Availability

Version 5.5