POV-Ray : Newsgroups : povray.general : Undefine macro? : Re: Undefine macro? Server Time
7 Aug 2024 01:21:13 EDT (-0400)
  Re: Undefine macro?  
From:
Date: 7 Dec 2001 07:44:41
Message: <fvd11uobje6lksrem9uvv32761em5l6pf8@4ax.com>
On Thu, 6 Dec 2001 15:24:59 +0100, "Rune" <run### [at] mobilixnetdk> wrote:
> I really need to be able to undefine macros, but it doesn't seem to be
> possible...?

Could it be good workaround for you ?

#version 3.5;
#include "strings.inc"
#macro Define_Macro(Name)
  Parse_String(concat("#declare Macro_",Name,"_Defined=yes"))
#end
#macro Undefine_Macro(Name)
  Parse_String(concat("#undef Macro_",Name,"_Defined"))
#end
#macro Is_Macro_Defined(Name)
  Parse_String(concat("(defined(Macro_",Name,"_Defined)"))
#end

I have not tested this becouse of "Instances" problem of current beta, sorry.

ABX
--
#declare _=function(a,b,x){((a^2)+(b^2))^.5-x}#default {pigment{color rgb 1}}
union{plane{y,-3}plane{-x,-3}finish{reflection 1 ambient 0}}isosurface{ //ABX
function{_(x-2,y,1)|_((x+y)*.7,z,.1)|_((x+y+2)*.7,z,.1)|_(x/2+y*.8+1.5,z,.1)}
contained_by{box{<0,-3,-.1>,<3,0,.1>}}translate z*15finish{ambient 1}}//POV35


Post a reply to this message

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