|
![](/i/fill.gif) |
"Thorsten Froehlich" <tho### [at] trf de> wrote in message
news:404613b0@news.povray.org...
> In article <4046089f$1@news.povray.org> , "Jaap Frank" <jjf### [at] xs4all nl>
> 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
|
![](/i/fill.gif) |