Difference between revisions of "Axis new"
Cg huyphong (talk | contribs) |
|||
Line 1: | Line 1: | ||
− | + | {{HelpFiles}} | |
− | {{HelpFiles}} | ||
− | ====Axis_new==== | + | ==== Axis_new ==== |
− | This function is the Axis object's constructor and will return an array which must have 7 elements, configured like specified below: | + | This function is the Axis object's constructor and will return an array which must have 7 elements, configured like specified below: |
− | * OBJECT_TYPE: Object type information. It must have the same value as TYPE_AXIS constant. | + | *OBJECT_TYPE: Object type information. It must have the same value as TYPE_AXIS constant. |
− | * AXIS_NAME: The name of the axis, it is the value of the argument name passed to the constructor function. | + | *AXIS_NAME: The name of the axis, it is the value of the argument name passed to the constructor function. |
− | * AXIS_TEXT: The text for the axis. It has "" as its value when first created. | + | *AXIS_TEXT: The text for the axis. It has "" as its value when first created. |
− | * AXIS_MATH_BASE: The math base for the axis. It has "" as its value when first created. | + | *AXIS_MATH_BASE: The math base for the axis. It has "" as its value when first created. |
− | * AXIS_PCT_BASE: The percentage base for the axis. It has "" as its value when first created. | + | *AXIS_PCT_BASE: The percentage base for the axis. It has "" as its value when first created. |
− | * AXIS_WEIGHT: The weight flag specifying whether the axis can be used as a weight or not. It has ''false ''as its value when first created. | + | *AXIS_WEIGHT: The weight flag specifying whether the axis can be used as a weight or not. It has ''false ''as its value when first created. |
− | * AXIS_OPTIONS: The array of axis options, it is initialized as an array with no elements. | + | *AXIS_OPTIONS: The array of axis options, it is initialized as an array with no elements. |
− | '''Syntax''' | + | '''Syntax''' |
− | Axis_new(''name'') | + | Axis_new(''name'') |
− | '''Arguments''' | + | '''Arguments''' |
− | ''name: ''Is a string expression. It is the name of the axis. | + | ''name: ''Is a string expression. It is the name of the axis. |
− | '''Return type''' | + | '''Return type''' |
− | array | + | array |
− | '''Examples''' | + | '''Examples''' |
− | array axis = Axis_new("Age groups"); | + | ''array axis = Axis_new("Age groups");'' |
− | axis | + | ''print(axis); '' |
− | '' | + | ''//Result: {0,Age groups,,,,False,{},}'' |
− | Version 5.5 | + | ''axis[AXIS_TEXT] = "Choose an age group"; '' |
− | __NOTOC__ | + | |
− | <!-- imported from file: 5438.htm--> | + | ''axis[AXIS_MATH_BASE] = "Age"; '' |
+ | |||
+ | ''axis[AXIS_PCT_BASE] = "Age != empty";'' | ||
+ | |||
+ | ''print(axis);'' | ||
+ | |||
+ | ''//Result: {0,Age groups,Choose an age group,Age,Age != empty,False,{},}'' | ||
+ | |||
+ | '''Availability''' | ||
+ | |||
+ | Version 5.5 __NOTOC__ <!-- imported from file: 5438.htm--> | ||
+ | |||
+ | [[Category:Axis_set_modifying_CGScript_functions]] |
Revision as of 08:53, 23 December 2011
Axis_new
This function is the Axis object's constructor and will return an array which must have 7 elements, configured like specified below:
- OBJECT_TYPE: Object type information. It must have the same value as TYPE_AXIS constant.
- AXIS_NAME: The name of the axis, it is the value of the argument name passed to the constructor function.
- AXIS_TEXT: The text for the axis. It has "" as its value when first created.
- AXIS_MATH_BASE: The math base for the axis. It has "" as its value when first created.
- AXIS_PCT_BASE: The percentage base for the axis. It has "" as its value when first created.
- AXIS_WEIGHT: The weight flag specifying whether the axis can be used as a weight or not. It has false as its value when first created.
- AXIS_OPTIONS: The array of axis options, it is initialized as an array with no elements.
Syntax
Axis_new(name)
Arguments
name: Is a string expression. It is the name of the axis.
Return type
array
Examples
array axis = Axis_new("Age groups");
print(axis);
//Result: {0,Age groups,,,,False,{},}
axis[AXIS_TEXT] = "Choose an age group";
axis[AXIS_MATH_BASE] = "Age";
axis[AXIS_PCT_BASE] = "Age != empty";
print(axis);
//Result: {0,Age groups,Choose an age group,Age,Age != empty,False,{},}
Availability
Version 5.5