Difference between revisions of "CustomColumn removeOption"
(jrfconvert import) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{HelpFiles}} | |
− | | ||
− | ====CustomColumn_removeOption==== | + | ==== CustomColumn_removeOption ==== |
− | Removes the custom column option with the option index, passed as argument to the method, from the custom column. Returns false if there is no option with the specified index existing, returns true otherwise. | + | Removes the custom column option with the option index, passed as argument to the method, from the custom column. Returns false if there is no option with the specified index existing, returns true otherwise. |
− | '''Syntax''' | + | '''Syntax''' |
− | CustomColumn_removeOption(''customColumn'', ''optionIndex'') | + | CustomColumn_removeOption(''customColumn'', ''optionIndex'') |
− | '''Arguments''' | + | '''Arguments''' |
− | ''customColumn'': Is an array. This is the custom column array created by CustomColumn_new function. | + | ''customColumn'': Is an array. This is the custom column array created by CustomColumn_new function. |
− | ''optionIndex'': Is a numeric expression. It is the index of the option returned by CustomColumn_addOption function. | + | ''optionIndex'': Is a numeric expression. It is the index of the option returned by CustomColumn_addOption function. |
− | '''Return type''' | + | '''Return type''' |
− | Boolean | + | Boolean |
− | '''Examples''' | + | '''Examples''' |
− | + | ''array customColumn = CustomColumn_new(CUSTOM_COLUMN_TYPE_NUMBER, "AgeGroup");'' | |
− | '' | + | ''customColumn[CUSTOM_COLUMN_TEXT] = "Age groups";'' |
− | Version 5.5 | + | ''array customColumnOption_Kid = CustomColumnOption_new("Age < 15", 1, "Kid");'' |
− | __NOTOC__ | + | |
− | <!-- imported from file: 5214.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); '' | ||
+ | |||
+ | ''print(customColumn);'' | ||
+ | |||
+ | ''//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}},} | ||
+ | |||
+ | CustomColumn_removeOption(customColumn, 0); '' | ||
+ | |||
+ | ''print(customColumn);'' | ||
+ | |||
+ | ''//Result: {2,1,AgeGroup,Age groups,{{3,Age == [15-18],2,Teen},{3,Age == [19-45],3,Adult},{3,Age > 45,4,Senior}},}'' | ||
+ | |||
+ | '''Availability''' | ||
+ | |||
+ | Version 5.5 __NOTOC__ <!-- imported from file: 5214.htm--> | ||
+ | |||
+ | [[Category:Data_cache_modifying_CGScript_functions]] |
Latest revision as of 11:55, 23 December 2011
CustomColumn_removeOption
Removes the custom column option with the option index, passed as argument to the method, from the custom column. Returns false if there is no option with the specified index existing, returns true otherwise.
Syntax
CustomColumn_removeOption(customColumn, optionIndex)
Arguments
customColumn: Is an array. This is the custom column array created by CustomColumn_new function.
optionIndex: Is a numeric expression. It is the index of the option returned by CustomColumn_addOption function.
Return type
Boolean
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);
print(customColumn);
//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}},}
CustomColumn_removeOption(customColumn, 0);
print(customColumn);
//Result: {2,1,AgeGroup,Age groups,{{3,Age == [15-18],2,Teen},{3,Age == [19-45],3,Adult},{3,Age > 45,4,Senior}},}
Availability
Version 5.5