Axis optionExists

From Catglobe Wiki
Jump to: navigation, search



Axis_optionExists

Returns true if the given axis contains axis options matching the name passed as argument to the method and false otherwise.

Syntax

Axis_optionExists(axis, optionName)

Arguments

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

optionName: Is a string expression, which is name of the option to look up.

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

bool b = Axis_optionExists(axis, "Under 18");

if (b) print("Axis option \"Under 18\" exists.");

else print("Axis option \"Under 18\" does not exist.");

//Result: Axis option "Under 18" does not exist.

Availability

Version 5.5