POV-Ray : Newsgroups : povray.general : Pass array to macro. : Re: Pass array to macro. Server Time
19 Apr 2024 17:26:07 EDT (-0400)
  Re: Pass array to macro.  
From: jr
Date: 12 Apr 2020 06:15:01
Message: <web.5e92e8fa9cacd3d7827e2b3e0@news.povray.org>
hi,

kurtz le pirate <kur### [at] gmailcom> wrote:
> Hello,
>
> With this code :
>
> ...
> Running this code raise en error :
>    Parse Error: Expected '[', ,  found instead
> for the line highlighted above
>
>
> The macro drawLine can't understand that "thisLine" parameter is an
> array of two elements.
> So it seems that i can't pass an array as a parameter to a macro ?

"Although it is permissible to reference an entire array as a whole, you may not
reference just one dimension of a multi-dimensional array."
<http://wiki.povray.org/content/Reference:Array>

> Is my prognosis correct and is there any solution (other than split
> array's item into two variables).

you could declare an array of arrays, ie
#declare ListOfLines = array [N] {
  array [2] {point, point},
  ...
  array [2] {point, point}
};


regards, jr.


Post a reply to this message

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