Difference between revisions of "Axis removeOption"
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{HelpFiles}} | |
− | | ||
− | ====Axis_removeOption==== | + | ==== Axis_removeOption ==== |
− | Removes an axis option with the option index passed as argument to the method. If the option index is smaller than 0 or larger than the number of axis options minus one then return false and nothing is removed. Else it will remove the axis option positioned at the option index passed as argument to the method and return true. | + | Removes an axis option with the option index passed as argument to the method. If the option index is smaller than 0 or larger than the number of axis options minus one then return false and nothing is removed. Else it will remove the axis option positioned at the option index passed as argument to the method and return true. |
− | When using string name it is slightly different. Then returns true if anything was removed and false otherwise. | + | When using string name it is slightly different. Then returns true if anything was removed and false otherwise. |
− | '''Syntax''' | + | '''Syntax''' |
− | Axis_removeOption(''axis'', ''optionIndex'') | + | Axis_removeOption(''axis'', ''optionIndex'') |
− | or | + | or |
− | Axis_removeOption(''axis'', ''name'') | + | Axis_removeOption(''axis'', ''name'') |
− | '''Arguments''' | + | '''Arguments''' |
− | ''axis'': Is an axis array, created by Axis_new function. | + | ''axis'': Is an axis array, created by Axis_new function. |
− | ''optionIndex'': Is a number expression. It is the index of the axis option in the option list, returned by Axis_addOption function. | + | ''optionIndex'': Is a number expression. It is the index of the axis option in the option list, returned by Axis_addOption function. |
− | ''name'': Is a string expression. It is the name of the axis option. | + | ''name'': Is a string expression. It is the name of the axis option. |
− | '''Return type''' | + | '''Return type''' |
− | bool | + | bool |
− | '''Examples''' | + | '''Examples''' |
− | + | ''array axis = AxisSet_getAxis("Sex");'' | |
− | '' | + | ''print(axis[AXIS_OPTIONS]);'' |
− | Version 5.5 | + | ''//Result: {{1,Mand,Sex == [1],},{1,Kvinde,Sex == [2],}}'' |
− | __NOTOC__ | + | |
− | <!-- imported from file: 5229.htm--> | + | ''Axis_removeOption(axis, 0); '' |
+ | |||
+ | ''print(axis[AXIS_OPTIONS]);'' | ||
+ | |||
+ | ''//Result: {{1,Kvinde,Sex == [2],}}'' | ||
+ | |||
+ | '''Availability''' | ||
+ | |||
+ | Version 5.5 __NOTOC__ <!-- imported from file: 5229.htm--> | ||
+ | |||
+ | [[Category:Axis_set_modifying_CGScript_functions]] |
Latest revision as of 09:38, 23 December 2011
Axis_removeOption
Removes an axis option with the option index passed as argument to the method. If the option index is smaller than 0 or larger than the number of axis options minus one then return false and nothing is removed. Else it will remove the axis option positioned at the option index passed as argument to the method and return true.
When using string name it is slightly different. Then returns true if anything was removed and false otherwise.
Syntax
Axis_removeOption(axis, optionIndex)
or
Axis_removeOption(axis, name)
Arguments
axis: Is an axis array, created by Axis_new function.
optionIndex: Is a number expression. It is the index of the axis option in the option list, returned by Axis_addOption function.
name: Is a string expression. It is the name of the axis option.
Return type
bool
Examples
array axis = AxisSet_getAxis("Sex");
print(axis[AXIS_OPTIONS]);
//Result: {{1,Mand,Sex == [1],},{1,Kvinde,Sex == [2],}}
Axis_removeOption(axis, 0);
print(axis[AXIS_OPTIONS]);
//Result: {{1,Kvinde,Sex == [2],}}
Availability
Version 5.5