CustomColumn optionExists: Difference between revisions
More actions
Cg huyphong (talk | contribs) No edit summary  | 
				No edit summary  | 
				||
| Line 1: | Line 1: | ||
{{HelpFiles}}    | |||
{{HelpFiles}}  | |||
====CustomColumn_optionExists====  | ==== CustomColumn_optionExists ====  | ||
Returns true if the given custom column contains custom column options matching the value passed as argument to the method and false otherwise.  | Returns true if the given custom column contains custom column options matching the value passed as argument to the method and false otherwise.    | ||
'''Syntax'''  | '''Syntax'''    | ||
CustomColumn_optionExists(''customColumn'', v''alue'')  | CustomColumn_optionExists(''customColumn'', v''alue'')    | ||
'''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.    | ||
''value'': Is an expression of the same type as the specified custom column.  | ''value'': Is an expression of the same type as the specified custom column.    | ||
'''Return type'''  | '''Return type'''    | ||
bool  | bool    | ||
'''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";''  | ||
array customColumnOption_Kid = CustomColumnOption_new("Age   | ''array customColumnOption_Kid = CustomColumnOption_new("Age < 15", 1, "Kid");''  | ||
CustomColumn_addOption(customColumn, customColumnOption_Kid );  | ''CustomColumn_addOption(customColumn, customColumnOption_Kid );''  | ||
bool b = CustomColumn_optionExists(customColumn, 1); //true  | ''bool b = CustomColumn_optionExists(customColumn, 1); //true ''  | ||
''  | ''if (b) print("Option \"Kid\" exists");''  | ||
Version 5.5  | ''else print("Option \"Kid\" does not exist");''  | ||
__NOTOC__  | |||
<!-- imported from file: 5216.htm-->  | ''//Result: Option "Kid" exists''  | ||
'''Availability'''   | |||
Version 5.5 __NOTOC__ <!-- imported from file: 5216.htm-->    | |||
[[Category:Data_cache_modifying_CGScript_functions]]  | |||
Latest revision as of 10:35, 23 December 2011
CustomColumn_optionExists
Returns true if the given custom column contains custom column options matching the value passed as argument to the method and false otherwise.
Syntax
CustomColumn_optionExists(customColumn, value)
Arguments
customColumn: Is an array. This is the custom column array created by CustomColumn_new function.
value: Is an expression of the same type as the specified custom column.
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");
CustomColumn_addOption(customColumn, customColumnOption_Kid );
bool b = CustomColumn_optionExists(customColumn, 1); //true
if (b) print("Option \"Kid\" exists");
else print("Option \"Kid\" does not exist");
//Result: Option "Kid" exists
Availability
Version 5.5