POV-Ray : Newsgroups : povray.advanced-users : Detecting .inc file inclusion from another file : Re: Detecting .inc file inclusion from another file Server Time
29 Jun 2024 01:55:58 EDT (-0400)
  Re: Detecting .inc file inclusion from another file  
From: stbenge
Date: 19 Jun 2010 18:18:12
Message: <4c1d4224@news.povray.org>
clipka wrote:
> Am 19.06.2010 22:37, schrieb stbenge:
> 
>> Is there a method for finding out if an .inc file was included from
>> another file, within the included file itself?
> 
> None that I know of - unless you know which file(s) it might be included 
> by, and setting a certain variable there before including. E.g.:
> 
> //---------------------------
> // my_scene.pov
> //---------------------------
> #declare MY_INCLUDE_FLAG = 1;
> #incude "my_include_file.inc"
> ...
> 
> //---------------------------
> // my_include_file.inc
> //---------------------------
> #ifndef (MY_INCLUDE_FLAG)
>   // set camera etc.
> #end
> ...

That's a good idea, thanks!


Post a reply to this message

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