Axis new

From Catglobe Wiki
Jump to: navigation, search



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.
  • AXIS_MATH_BASE_MODIFIER: The math base modifier for the axis. It has "" as its value when first created.

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