POV-Ray : Newsgroups : povray.general : Problem with Parse_String and #ifndef : Re: Problem with Parse_String and #ifndef Server Time
4 Aug 2024 06:10:32 EDT (-0400)
  Re: Problem with Parse_String and #ifndef  
From: Tim Nikias v2 0
Date: 10 Sep 2003 18:02:15
Message: <3f5f9f67$1@news.povray.org>
> Thanks Tim!
>
> Greetings,
> Florian

You're welcome. I figured this one pretty
fast because I had similiar ideas about dynamic
texture/array/object generation some months
ago, and gave thought to those issues at
that time. And seeing your code, it was
rather simple to just write my initial thoughts
about it... :-)

-- 
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
Email: no_lights (@) digitaltwilight.de


> Hi Tim!
>
> > You've got to experiment. Perhaps writing the entire
> > #ifndef () ... #debug ".." #end
> > to disc and #including that.
> That did the job!
>
> if anyone is interested, here's the code:
>
> <code>
> #include "strings.inc"
>
> #declare TestIdent = 1;
>
> #macro IFDEF2(Name)
> #declare TEMPDEF__ = 0;
>
> Parse_String(concat(
> "#ifdef(",Name,")
> #declare TEMPDEF__=1;
> #end"
> ))
>
> (TEMPDEF__)
> #end
>
> #if (IFDEF2("TestIdent"))
> #debug "defined\n"
> #else
> #debug "nope\n"
> #end
> </code>
>
> result: defined
>
> Thanks Tim!
>
> Greetings,
> Florian
> -- 
> //=================[web: http://www.torfbold.com]==================\\
> #local a=-5;#while(a<5)sphere{<sin(a*pi)*5a*10pow(a,5)*.01>sin(a*a*a*
> .1)+1pigment{rgb 9*z}}#local a=a+.01;#end camera{look_at-y*10location
> <8,-3,-8>*10}// [www.povray.org]     [www.imp.org]     [www.irtc.org]
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 01.09.2003


Post a reply to this message

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