Difference between revisions of "Axis addOption"

From Catglobe Wiki
Jump to: navigation, search
 
Line 1: Line 1:
[[Category:Axis set modifying CGScript functions]]
+
 {{HelpFiles}}  
{{HelpFiles}}
 
  
====Axis_addOption====
+
==== Axis_addOption ====
  
Adds an axis option to the end of the array containing the axis options in the axis passed as argument to the method, and returns its index in the option list.
+
Adds an axis option to the end of the array containing the axis options in the axis passed as argument to the method, and returns its index in the option list.  
  
'''Syntax'''
+
'''Syntax'''  
  
Axis_addOption(''axis'', ''axisOption'')
+
Axis_addOption(''axis'', ''axisOption'')  
  
'''Arguments'''
+
'''Arguments'''  
  
''axis'': Is an axis array created by Axis_new function.
+
''axis'': Is an axis array created by Axis_new function.  
  
''axisOption'': Is an axis option array, created by AxisOption_new function.
+
''axisOption'': Is an axis option array, created by AxisOption_new function.  
  
'''Return type'''
+
'''Return type'''  
  
Number
+
Number  
  
'''Examples'''
+
'''Examples'''  
  
number index = Axis_addOption(myAxis, myOption);
+
''array axis = Axis_new("Age groups");''
  
'''Availability'''
+
''axis[AXIS_TEXT] = "Choose an age group";''
  
Version 5.5
+
''axis[AXIS_MATH_BASE] = "Age";''
__NOTOC__
+
 
<!-- imported from file: 5228.htm-->
+
''axis[AXIS_PCT_BASE] = "Age != empty";''
 +
 
 +
''number index1 = Axis_addOption(axis, AxisOption_new("Under 18", "Age < 18"));''
 +
 
 +
''number index2 = Axis_addOption(axis, AxisOption_new("18 - 29", "Age == [18-29]"));''
 +
 
 +
''print(index1); //Result: 0''
 +
 
 +
''print(index2); //Result: 1''
 +
 
 +
'''Availability'''
 +
 
 +
Version 5.5 __NOTOC__ <!-- imported from file: 5228.htm-->  
 +
 
 +
[[Category:Axis_set_modifying_CGScript_functions]]

Latest revision as of 11:26, 23 December 2011



Axis_addOption

Adds an axis option to the end of the array containing the axis options in the axis passed as argument to the method, and returns its index in the option list.

Syntax

Axis_addOption(axis, axisOption)

Arguments

axis: Is an axis array created by Axis_new function.

axisOption: Is an axis option array, created by AxisOption_new function.

Return type

Number

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";

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

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

print(index1); //Result: 0

print(index2); //Result: 1

Availability

Version 5.5