POV-Ray : Newsgroups : povray.general : array.length()? : Re: array.length()? Server Time
30 Jul 2024 18:21:36 EDT (-0400)
  Re: array.length()?  
From: Bill Pragnell
Date: 25 Feb 2009 04:20:00
Message: <web.49a50c3678dc09ae6dd25f0b0@news.povray.org>
> "Bill Pragnell" <bil### [at] hotmailcom> wrote in message
> > Just an extra thought - couldn't you globally #declare your array size
> > when you
> > populate it, then use this value in the second macro?

"[GDS|Entropy]" <gds### [at] hotmailcom> wrote:
> I had a version which did this, but I could only summon it once, as any
> subsequent incarnations redefined the contents upon each call.

I'm not sure I understand the problem... based on the first paragraph of your
original post, if you keep track of the number of array elements in the first
macro and #declare an array_size variable (not #local), then this number will
be available for all subsequent code, just like the array, and you will know how
many elements to loop through. If you call the same macro again, it will simply
redefine this counter to reflect the new array contents... is this not what you
want to do?

I've got the vague feeling that I'm missing something, as this seems too easy a
solution compared with other replies! :-)

Bill


Post a reply to this message

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