POV-Ray : Newsgroups : povray.advanced-users : ifdef() : Re: ifdef() Server Time
28 Jul 2024 20:29:10 EDT (-0400)
  Re: ifdef()  
From: Jaap Frank
Date: 3 Mar 2004 13:04:47
Message: <40461e3f@news.povray.org>
"Thorsten Froehlich" <tho### [at] trfde> wrote in message
news:404613b0@news.povray.org...
> In article <4046089f$1@news.povray.org> , "Jaap Frank" <jjf### [at] xs4allnl>
> wrote:
>
> > There is no problem with assigning a value but testing is obviously not
> > possible.
>
> You cannot test if an array element is defined, that does not make sense
at
> because the array is either defined or not, independent of the elements.
> The manual at no point claims what you want to do would be possible.  If
you
> want to know if a specific element exists, you should use the array size,
> and simply not add elements that do not contain the information you do not
> want to store in the first place.
>
>     Thorsten

Thorsten, I'm sorry for talking about defining, I ment assigning:

| From the manual:
|
| The #ifdef and #ifndef directives can be used to determine whether
| a specific element of an array has been assigned.
|
| #declare MyArray=array[10]
| //#declare MyArray[0]=7;
| #ifdef(MyArray[0])
|    #debug "first element is assigned\n"
| #else
|    #debug "first element is not assigned\n"
|  #end

You can assign an value in one step in my example, but you can't test
in one step if a value is assigned.
Is it wrong to expect that the test could be done in one step?
(By the way, I can't follow your last sentence, it contains to
many negations, but I think you mean something like you can't test
something that's not existing.)

Jaap Frank


Post a reply to this message

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