AxisSet updateAxis

From Catglobe Wiki
Jump to: navigation, search



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