ChaosPro Home
Introduction
What's New
Palettes
Using Formulas
Layering in ChaosPro
Rendering
Fractal Parameter Windows
Windows
Menu
3D Transformations
Animations
Formula Compiler
Writing Formulas
Language Reference
Introduction
Basic Syntax
Datatypes
Constants
Variables
Expressions
Operators
Functions
Control Structures
Compiler Directives
Functions
Interface to ChaosPro
Escapetime Formulas
Quaternion Formulas
Attractor Formulas
Libraries
How it works together
Description function
this.angle
this.center
this.helpfile
this.helptopic
this.magn
this.maxiter
this.method
this.periodicity
this.title
<param>.caption
<param>.default
<param>.enabled
<param>.enum
<param>.hint
<param>.max
<param>.min
<param>.randomizable
<param>.randomizationType
<param>.randomizeMin
<param>.randomizeMax
<param>.visible
<func>.caption
<func>.default
<func>.hint
Special Features, Notes...
Compatibility
Fractal Type Reference
Tutorials
Appendix
CHAOSPRO 4.0
Release 4.0
.

Description - <parametername>.enum

Name: <parametername>.enum

Type: String

Description:

This parameter based attribute can be used only on int-parameters. Sometimes a formula has some switches, say a parameter can have only a few values, each value has a special meaning.

Lets make an example:

parameter int iMode;

void loop(void)
{
   if (iMode==0)
   {
      z=sin(z)+pixel;
   }
   else if (iMode==1)
   {
      z=cos(z)+pixel;
   }
   else if (iMode==2)
   {
      z=tan(z)+pixel;
   }
}
void description(void)
{
   iMode.enum="Sinus Iteration\nCosinus Iteration\nTangent Iteration";
} 

So let's say you have a parameter of type int, which you would like to use to select the iteration mode (see above): Now it would be quite confusing for any user of your formula if he/she has to select an integer number from 0 to 2 and this would choose the iteration mode. Right?

So you can specify the enum property, which lets you define strings for integer numbers starting with 0. By providing the enum property the user will see a drop down combobox with (in the example above three) possibilities.
The user then can choose one option and it will be mapped to the correct integer number.

The value of the enum property (i.e. the string) must consist of different options (separated by \n). Integer numbers are assigned to the options in their order, starting with 0.

Note:
New in ChaosPro 3.1: You may directly compare your parameters with the enumeration options: In the example above you could write:

void loop(void)
{
   if (iMode=="Sinus Iteration")
   {
      z=sin(z)+pixel;
   }
   else if (iMode=="Cosinus Iteration")
   {
      z=cos(z)+pixel;
   }
   else if (iMode=="Tangent Iteration")
   {
      z=tan(z)+pixel;
   }
}
void description(void)
{
   iMode.enum="Sinus Iteration\nCosinus Iteration\nTangent Iteration";
}