Difference between revisions of "AxisSet addAxis"
(jrfconvert import) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{HelpFiles}} | |
− | | ||
− | ====AxisSet_addAxis==== | + | ==== 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. | + | 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''' | + | '''Syntax''' |
− | AxisSet_addAxis(''axis'') | + | AxisSet_addAxis(''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 = Axis_new("Age groups");'' | |
− | '' | + | ''axis[AXIS_TEXT] = "Choose an age group";'' |
− | Version 5.5 | + | ''axis[AXIS_MATH_BASE] = "Age";'' |
− | __NOTOC__ | + | |
− | <!-- imported from file: 5234.htm--> | + | ''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 __NOTOC__ <!-- imported from file: 5234.htm--> | ||
+ | |||
+ | [[Category:Axis_set_modifying_CGScript_functions]] |
Latest revision as of 10:20, 23 December 2011
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