Difference between revisions of "AxisSet updateAxis"
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{HelpFiles}} | |
− | | ||
− | ====AxisSet_updateAxis==== | + | ==== AxisSet_updateAxis ==== |
− | Updates the axis specified as argument to the method. If no axis exists in the axis-set with the axis name then return false without updating anything. Else the axis in the axis-set is updated with the state found in the axis array passed as argument overwriting the current axis in the axis-set and the function returns true. | + | Updates the axis specified as argument to the method. If no axis exists in the axis-set with the axis name then return false without updating anything. Else the axis in the axis-set is updated with the state found in the axis array passed as argument overwriting the current axis in the axis-set and the function returns true. |
− | '''Syntax''' | + | '''Syntax''' |
− | AxisSet_updateAxis(''axis'') | + | AxisSet_updateAxis(''axis'') |
− | '''Arguments''' | + | '''Arguments''' |
− | ''axis'': Is an axis array, created by Axis_new function. | + | ''axis'': Is an axis array, created by Axis_new function. |
− | '''Return type''' | + | '''Return type''' |
− | bool | + | bool |
− | '''Examples''' | + | '''Examples''' |
− | + | ''array axis = AxisSet_getAxis("Sex");'' | |
− | '' | + | ''print(axis); '' |
− | Version 5.5 | + | ''//Result: {0,Sex,Hvad er dit køn?,Sex,Sex != empty,False,{{1,Mand,Sex == [1],},{1,Kvinde,Sex == [2],}},}'' |
− | __NOTOC__ | + | |
− | <!-- imported from file: 5235.htm--> | + | ''Axis_addOption(axis, AxisOption_new("Ved ikke svar", "Sex == [3]"));'' |
+ | |||
+ | ''bool b = AxisSet_updateAxis(axis);'' | ||
+ | |||
+ | ''if (b) print("Axis was updated");'' | ||
+ | |||
+ | ''else print("Axis does not exist"); '' | ||
+ | |||
+ | ''//Result: Axis was updated'' | ||
+ | |||
+ | ''print(axis);'' | ||
+ | |||
+ | ''//Result: {0,Sex,Hvad er dit køn?,Sex,Sex != empty,False,{{1,Mand,Sex == [1],},{1,Kvinde,Sex == [2],},{1,Ved ikke svar,Sex < 3,}},}'' | ||
+ | |||
+ | '''Availability''' | ||
+ | |||
+ | Version 5.5 __NOTOC__ <!-- imported from file: 5235.htm--> | ||
+ | |||
+ | [[Category:Axis_set_modifying_CGScript_functions]] |
Latest revision as of 10:42, 23 December 2011
AxisSet_updateAxis
Updates the axis specified as argument to the method. If no axis exists in the axis-set with the axis name then return false without updating anything. Else the axis in the axis-set is updated with the state found in the axis array passed as argument overwriting the current axis in the axis-set and the function returns true.
Syntax
AxisSet_updateAxis(axis)
Arguments
axis: Is an axis array, created by Axis_new function.
Return type
bool
Examples
array axis = AxisSet_getAxis("Sex");
print(axis);
//Result: {0,Sex,Hvad er dit køn?,Sex,Sex != empty,False,{{1,Mand,Sex == [1],},{1,Kvinde,Sex == [2],}},}
Axis_addOption(axis, AxisOption_new("Ved ikke svar", "Sex == [3]"));
bool b = AxisSet_updateAxis(axis);
if (b) print("Axis was updated");
else print("Axis does not exist");
//Result: Axis was updated
print(axis);
//Result: {0,Sex,Hvad er dit køn?,Sex,Sex != empty,False,{{1,Mand,Sex == [1],},{1,Kvinde,Sex == [2],},{1,Ved ikke svar,Sex < 3,}},}
Availability
Version 5.5