POV-Ray : Newsgroups : povray.advanced-users : Evaluating macro result in array initialization Server Time
28 Mar 2024 17:42:37 EDT (-0400)
  Evaluating macro result in array initialization (Message 1 to 3 of 3)  
From: Bald Eagle
Subject: Evaluating macro result in array initialization
Date: 1 Aug 2021 20:40:00
Message: <web.61073e8fe4a528721f9dae3025979125@news.povray.org>
I'm trying to create a mixed array with vectors by using macro calls to define
the point locations.

POV-Ray (qtpovray 3.8) squawks with "Parse Error: Expected 'array initializer
element', macro identifier found instead"

Is this something we can't do?   Seemed weird.

#declare Array =
array mixed [2][5] {
 {"text",    Macro(0.00, 0.90), ....


Post a reply to this message

From: jr
Subject: Re: Evaluating macro result in array initialization
Date: 2 Aug 2021 03:40:00
Message: <web.6107a076f4a53de65e0fed26cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> I'm trying to create a mixed array with vectors by using macro calls to define
> the point locations.
>
> POV-Ray (qtpovray 3.8) squawks with "Parse Error: Expected 'array initializer
> element', macro identifier found instead"
>
> Is this something we can't do?   Seemed weird.
>
> #declare Array =
> array mixed [2][5] {
>  {"text",    Macro(0.00, 0.90), ....

works, did same recently.  try putting the call into parentheses (force another
round of expr eval), ie:

array mixed [2][5] {
  {"text", (Macro(0.00, 0.90)), ....


regards, jr.


Post a reply to this message

From: Alessio Sangalli
Subject: Re: Evaluating macro result in array initialization
Date: 13 Dec 2021 13:59:21
Message: <61b79809$1@news.povray.org>
On 02-Aug-21 00:38, jr wrote:

> works, did same recently.  try putting the call into parentheses (force another
> round of expr eval), ie:
> 
> array mixed [2][5] {
>    {"text", (Macro(0.00, 0.90)), ....

I'd put the extra parenthesis in the Macro body instead of the caller, 
less chances to forget when using.


Post a reply to this message

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