POV-Ray : Newsgroups : povray.general : Pass array to macro. : Re: Pass array to macro. Server Time
20 Apr 2024 03:39:05 EDT (-0400)
  Re: Pass array to macro.  
From: Bald Eagle
Date: 14 Apr 2020 06:40:01
Message: <web.5e95927a9cacd3d7fb0b41570@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:

> In my mind, passing array[i], allowed me to pass the two parameters
> present in the second dimension.

That's a common misconception - which is why "you can't do that" is in the docs.
 There's only so much code "under the hood", and the code that might allow you
to reliably do that - isn't.


> "array of arrays" is not the same as array[][] ?

It "is", but the point is about content, not form.
Array [][] is just a generic 2D array.
But when you fill the array with data, then it becomes an array of scalars, or
vectors, or ... arrays.



> For now, the simplest way is to pass two parameters to my macro.
> drawLine(ListOfLines[lineIndex][0],ListOfLines[lineIndex][1],0.05,
> GreenYellow)
>
> with :
> #macro drawLine(thisLineStart, thisLineEnd, lRadius, lColor)
>
>
> No more complications. Thankss


Correct - OR you could just hard-code the constant parameter in "drawline" if it
doesn't need to be variable.

Glad you got it working.   :)


Post a reply to this message

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