6.2  Language Directives

The POV Scene Language contains several statements called language directives which tell the file parser how to do its job. These directives can appear in almost any place in the scene file - even in the middle of some other statements. They are used to include other text files in the stream of commands, to declare identifiers, to define macros, conditional, or looped parsing and to control other important aspects of scene file processing.

Each directive begins with the hash character # (often called a number sign or pound sign). It is followed by a keyword and optionally other parameters.

In versions of POV-Ray prior to 3.0, the use of this # character was optional. Language directives could only be used between objects, camera or light_source statements and could not appear within those statements. The exception was the #include which could appear anywhere. Now that all language directives can be used almost anywhere, the # character is mandatory. The following keywords introduce language directives.

#break
#case
#debug
#declare
#default
#else
#end
#error
#fclose
#fopen
#if
#ifdef
#ifndef
#include
#local
#macro
#range
#read
#render
#statistics
#switch
#undef
#version
#warning
#while
#write

Earlier versions of POV-Ray considered the keyword #max_intersections and the keyword #max_trace_level to be language directives but they have been moved to the global_settings statement and should be placed there without the # sign. Their use as a directive still works but it generates a warning and may be discontinued in the future.

In 'Language Directives' ...
6.2.1  Include Files and the #include Directive.
6.2.2  The #declare and #local Directives
6.2.3  File I/O Directives
6.2.4  The #default Directive
6.2.5  The #version Directive
6.2.6  Conditional Directives
6.2.7  User Message Directives
6.2.8  User Defined Macros