|
|
In article <web.3db9de67c659261a49b801190@news.povray.org>,
"sharl" <le.### [at] freefr> wrote:
> Would it be possible to add a #require command, as in php.
> This would add the file only *once* for each scene, no matter
> how often the #require"this_file" is found.
>
> Or is there already a good way to avoid multiple including of a file ?
The usual way is to use an "inclusion guard", something like this:
#ifndef MYFILE_INC
#declare MYFILE_INC = true;
...file contents...
#end
The official include files combine this with a way of saving the version
and restoring it at the end of the file.
--
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/
Post a reply to this message
|
|