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
Basics
Variable Scope
Predefined Variables
Parameters
Expressions
Operators
Functions
Control Structures
Compiler Directives
Functions
Interface to ChaosPro
Special Features, Notes...
Compatibility
Fractal Type Reference
Tutorials
Appendix
CHAOSPRO 4.0
Release 4.0
.

Parameters

Normally you define variables in order to do some calculations. But until now no user input has been mentioned. Writing a fractal formula could be easy, but it's boring if there is no parameter to play around. Now how could parameters introduced into this language?
The solution is: They are simple standard variables, but they are initialized by the end user using ChaosPro and its GUI components. The formula writer does not need to care about that.

Because parameters are just special variables, you need to first declare them before using them. And on declaring the parameters you just need to provide an additional keyword so ChaosPro can see that this variable needs to be initialized by the end user. This keyword has been named "parameter" and has to appear right in front of the variable declaration.

Examples

parameter complex zStart; // defines a complex parameter zStart: Normally variables are uninitialized after declaring them
                          // but this variable has been initialized by the end user.
parameter real Bailout,Bailout; // defines two real parameters

Parameter declarations can appear only on class level, not on function level.

Parameters can have several additional properties, for example a descriptive text label, a hint text, a default value and a range. This kind of meta information about a parameter must be set in a special function with the signature void description(void).