POV-Ray : Newsgroups : povray.advanced-users : Implementation of dynamically resized array : Re: Implementation of dynamically resized array Server Time
25 Apr 2024 22:36:50 EDT (-0400)
  Re: Implementation of dynamically resized array  
From: clipka
Date: 3 Nov 2018 09:17:38
Message: <5bdd9ff2$1@news.povray.org>
Am 02.11.2018 um 23:41 schrieb Bald Eagle:
> Hi all,
> 
> I was restructuring some code, and wanted to take advantage of using the new
> array features.
> 
> #local ToothPrismArray = array [1];
> 
> #local ToothPrismArray [0] = <_RC, _RC>;
> #local ToothPrismArray [1] = RotatePoint (<_RC, 0>, -_HT);
> #local ToothPrismArray [2] = RotatePoint (<_RB, 0>, -_HT);
> 
> When I get to the second line of element definitions, I get the old "Array
> subscript out of range" error.
> 
> Is there a trick to this?

Yes. The normal arrays are still fixed; you need to declare the array 
differently:

     #local ToothProsmArray = array;

Note the absence of any dimensions. This declares a one-dimensional 
variable-sized array.

Before anyone asks, multi-dimensional variable-sized arrays are not 
supported.


Post a reply to this message

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