POV-Ray : Newsgroups : povray.advanced-users : ifdef() : ifdef() Server Time
28 Jul 2024 20:19:59 EDT (-0400)
  ifdef()  
From: Jaap Frank
Date: 3 Mar 2004 11:32:31
Message: <4046089f$1@news.povray.org>
Hello,

I'm using the following construct for my code:

#declare A = array[2];
#declare B = array[2];

#declare B[0]=A;
#declare B[1]=A;
#declare B[0][0] = 18;

#ifdef (B[0][0])
 #debug "This is defined"
#end

If you use this the parser stops in the line #ifdef (B[0][0]) with the
cursor between [0] and [0] and says that it expects a closing bracket ')'.
(1)
There is no problem with assigning a value but testing is obviously not
possible.
You can circumvent this with:

#declare T=B[0];
#ifdef(T[0])
 #debug "This is defined"
#end

My question is why you can assign a value but can't test the existence of
the value in one step. Shouldn't it work as I was expecting?

Jaap Frank

PS  This is with the windows version 3.5.
       With 3.6 the cursor stops one character earlier.


Post a reply to this message

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