POV-Ray : Newsgroups : povray.advanced-users : Local variables in a function : Re: Local variables in a function Server Time
6 Oct 2024 14:00:59 EDT (-0400)
  Re: Local variables in a function  
From: Mike Williams
Date: 16 Jul 2006 07:46:48
Message: <X1O2yCA9WiuEFw7D@econym.demon.co.uk>
Wasn't it bugman who wrote:
>OK, I have a slightly different question. Is there any way to extract an
>array element in a function? For example:
>
>#declare xlist=array[3] {5.5,2.1,7.8};
>#declare getx=function(i) {xlist[int(i-1)]};

The nearest I've managed to get is this:

http://www.econym.demon.co.uk/isotut/arrays.htm

You can use the individual elements of arrays, but you can't index an
array from inside a function.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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