POV-Ray : Newsgroups : povray.advanced-users : Undefined variables : Re: Undefined variables Server Time
26 Apr 2024 09:20:07 EDT (-0400)
  Re: Undefined variables  
From: clipka
Date: 6 Feb 2018 08:10:18
Message: <5a79a93a$1@news.povray.org>
Am 05.02.2018 um 23:47 schrieb Mike Horvath:
> I am trying to create a macro:
> 
>   #macro BlurredReflection(InPigment, InFinish, InNormal)
>     ...
>   #end
> 
> But I don't want to *always* pass a value to the macro. Is there a way
> to pass a "null" or "nil" value to the macro, and then check for it
> using a conditional statement?

In the new versions, you can use e.g.

    #macro Fnord(A, optional B, C)
      #ifdef(local.B)
        #debug "Got a value for B.\n"
      #else
        #debug "B was left empty.\n"
      #endif
    #end

    Fnord(A,,C)


Post a reply to this message

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