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
User Defined Functions
Function Arguments
Returning Values
Interface to ChaosPro
Special Features, Notes...
Compatibility
Fractal Type Reference
Tutorials
Appendix
CHAOSPRO 4.0
Release 4.0
.

Functions - Return statement

Values are returned by using the return statement. The type returned must match the return type as specified in the function definition. The return statement causes the function to end its execution immediately and pass control back to the line from which it was called. See return() for more information.

real square (real num)
{
   return(num*num);
}

b=square (4);   // b=16;

You can't return multiple values from a function, but similar results can be obtained using an array as an argument or by specifying arguments as call-by-reference.