POV-Ray : Newsgroups : povray.general : 1D dynamic arrays Server Time
22 Dec 2024 02:33:00 EST (-0500)
  1D dynamic arrays (Message 1 to 2 of 2)  
From: Mike Horvath
Subject: 1D dynamic arrays
Date: 22 Jul 2018 00:25:13
Message: <5b540729$1@news.povray.org>
What is the correct syntax for creating dynamic arrays (new in POV 
3.7.1?) and adding new items to them?

http://wiki.povray.org/content/Reference:Array

The docs only show the old standard syntax as far as I can see.


Mike


Post a reply to this message

From: clipka
Subject: Re: 1D dynamic arrays
Date: 22 Jul 2018 00:51:42
Message: <5b540d5e$1@news.povray.org>
Am 22.07.2018 um 06:26 schrieb Mike Horvath:
> What is the correct syntax for creating dynamic arrays (new in POV
> 3.7.1?) and adding new items to them?

    #declare Foo = array;
    #declare Foo[42] = 4711;

This will create a resizable array with an initial size of zero, and
then grow the array to have a size of 43 (elements 0 through 42).

It is important to note that

    #ifdef(Foo[4711])

will also grow the array (to a size of 4712).


Post a reply to this message

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