|
|
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote in message
news:web.443d560fde047fad6c4803960@news.povray.org...
> Hmm, the problem seems to be as follows:
> declares of floats need to be followed by ';'
>
> #declare A=1;
>
> 1) placing the ';' outside an #if block doesn't work, the #else or #end is
> encountered before the semicolon is found
> #declare B= #if(A=1) 12 #else 13 #end; ---> doesn't work
>
> 2) placing the ';' inside an #if block does work
> #declare B= #if(A=1) 12; #else 13; #end ---> works
>
> essentially what is happening is event 1), the macro contents replace the
> macro call, thus the semicolon gets placed outside the #if block and
> generates an error. When placing this inside the str() or concat()
> functions, the semicolon is not required insdie the function and it parses
> fine.
Hi Trevor,
Prompted by your findings I tried just putting the macro call inside
brackets and that seems to work too:
#declare Test = (Rand_Array_Item(MyArray,RS));
#debug concat("Test2: ", str(Test,0,0), "\n")
Regards,
Chris B.
Post a reply to this message
|
|