AxisSet addAxis

From Catglobe Wiki
Jump to: navigation, search



AxisSet_addAxis

Adds the axis passed as argument to the method. If an axis already exists in the axis-set with the same name then return false without adding the axis. Else the axis will be added to the end of the axis-set and the function returns true.

Syntax

AxisSet_addAxis(axis)

Arguments

axis: Is an axis array, created by Axis_new function.

Return type

bool

Examples

array axis = Axis_new("Age groups");

axis[AXIS_TEXT] = "Choose an age group";

axis[AXIS_MATH_BASE] = "Age";

axis[AXIS_PCT_BASE] = "Age != empty";

Axis_addOption(axis, AxisOption_new("Under 18", "Age < 18"));

Axis_addOption(axis, AxisOption_new("18 - 29", "Age == [18-29]"));

Axis_addOption(axis, AxisOption_new("30 - 49", "Age == [30-49]"));

Axis_addOption(axis, AxisOption_new("Older 49", "Age > 49"));

bool exist = AxisSet_addAxis(axis);

print(axis);

//Result: {0,Age groups,Choose an age group,Age,Age != empty,False,{{1,Under 18,Age < 18,},{1,18 - 29,Age == [18-29],},{1,30 - 49,Age == [30-49],},{1,Older 49,Age > 49,}},}

Availability

Version 5.5