POV-Ray : Newsgroups : povray.advanced-users : Undefined variables : Re: Undefined variables Server Time
23 Jun 2024 22:17:37 EDT (-0400)
  Re: Undefined variables  
From: Mike Horvath
Date: 6 Feb 2018 08:16:54
Message: <5a79aac6$1@news.povray.org>
On 2/6/2018 8:10 AM, clipka wrote:
> 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)
> 

Interesting, thanks.


Mike


Post a reply to this message

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