POV-Ray : Newsgroups : povray.general : Empty value for variable : Re: Empty value for variable Server Time
26 Mar 2023 05:41:06 EDT (-0400)
  Re: Empty value for variable  
From: Bald Eagle
Date: 4 Feb 2023 09:45:00
Message: <web.63de6e4f5d560c741f9dae3025979125@news.povray.org>
"yesbird" <nomail@nomail> wrote:
> Hi, guys !
>
> Is there a way to assign an empty value to variable, using something like 'None'
> in Python or NULL in C ? I would like to use it while passing parameters to
> macros, for more compact notation.
> Can not find any info in docs about it.
>
> Thanks in advance,
> --
> YB

As jr pointed out, there are work-arounds.
I find the optional keyword, and its required commas to be awkward and clunky.

Can you store your macro parameters in an array?
Then the array will exist, but it might not have certain elements defined.  Then
you test each element in the size of the array
#declare SizeOfArray = dimension_size (Array, 1)-1;
#for (i, 0, SizeOfArray)
     #if (!defined (Array[i])
     .....
#end

Just another option.


Post a reply to this message

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