Compiler directives

Compiler directives enable you to conditionally compile or leave out entire blocks of code. Here is a list of all compiler directives:

With compiler directives, it is easy to have two different versions of a formula. For example, you might have a version that is used for testing and debugging, and a final version. Let’s assume the test version needs to show a different title. The following code would accomplish this:

  $define Test  ...  default:  $ifdef Test    title = "My Formula (test version)"  $else    title = "My Formula"  $endif    

Compiler directives enable you to switch between both versions by simply removing or inserting the $define statement at the top of the formula. (Note that in this example, the browsers will display the first title regardless of the compiler directives that are defined.)

Ultra Fractal 5 always defines the following symbols: ULTRAFRACTAL, VER20, VER30, VER40, and VER50. With the VERxx symbols, you can write formulas that take advantage of features in Ultra Fractal 5 but still compile under Ultra Fractal 4 or 3, where VER50 or even VER40 is not defined. Ultra Fractal 6 will define VER60. Example:

  default:    param ExtraMagnification      caption = "Extra Magnification"  $ifdef VER40      ; In Ultra Fractal 4, make sure this parameter is interpolated       ; exponentially by default.       exponential = true  $endif    endparam    


  • Compiler directives are case insensitive. They work across sections, loops and conditionals: they have a separate hierarchy.
  • The DEBUG symbol has a special meaning. See Debugging.

See Also
Exponential interpolation

Compiler directives