POV-Ray : Newsgroups : povray.general : #include vs #require : Re: #include vs #require Server Time
5 Aug 2024 08:26:33 EDT (-0400)
  Re: #include vs #require  
From: Tim Nikias
Date: 25 Oct 2002 20:39:50
Message: <3db9e456@news.povray.org>
In every of my include files, I have a parameter named
_tnw_includefile_ending_

So for my io_macs.inc this would be
_tnw_io_macs_inc_

And its just declared as 1 (similiar to true).

When a different file is based on such an include
file, it checks if that parameter is already declared,
and only includes if its not (using #ifndef).

This doesn't hinder the user from including it once
again AFTER some other include has included it,
but it takes care that all required files will be loaded
at least once, and won't issue warnings.

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde

> 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 ?
> Thanks.
> --
> sharl.
>
>
>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.