POV-Ray : Newsgroups : povray.general : Linked Arrays : Re: Linked Arrays Server Time
29 Jul 2024 14:14:57 EDT (-0400)
  Re: Linked Arrays  
From: Warp
Date: 3 May 2011 17:00:20
Message: <4dc06ce4@news.povray.org>
Leroy Whetstone <lrw### [at] joplincom> wrote:

> Warp wrote:
> >   The standard arrays.inc already provides a Sort_Array() macro.
> > 
> > http://wiki.povray.org/content/Documentation:Reference_Section_7#arrays.inc
> > 

> True, but it does one array! It doesn't move associated arrays with it. 
> My idea is you have a group of arrays linked so if you sort using one of 
> them all the others are also move around. The Sort_Array() macro could 
> be modified to do so. You would have to rewrite it for every time the 
> number of arrays you have changed.

  You don't need to rewrite it. You simply implement your own comparison
and swapping macros (Sort_Compare() and Sort_Swap_Data()) to perform those
operations.

-- 
                                                          - Warp


Post a reply to this message

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