POV-Ray : Newsgroups : povray.advanced-users : Hash arrays working yet? : Re: Hash arrays working yet? Server Time
26 Apr 2024 19:50:22 EDT (-0400)
  Re: Hash arrays working yet?  
From: clipka
Date: 13 Sep 2018 00:25:42
Message: <5b99e6c6$1@news.povray.org>
Am 13.09.2018 um 02:42 schrieb Mike Horvath:
> I am trying to define an array like this:
> 
> #declare MeanAnomalyToday = array[8]
> {
> CalcMeanAnomalyToday(0),
> CalcMeanAnomalyToday(1),
> CalcMeanAnomalyToday(2),
> CalcMeanAnomalyToday(3),
> CalcMeanAnomalyToday(4),
> CalcMeanAnomalyToday(5),
> CalcMeanAnomalyToday(6),
> CalcMeanAnomalyToday(7)
> }
> 
> The macro "CalcMeanAnomalyToday" returns a number.
> 
> #macro CalcMeanAnomalyToday(i)
>   2 * i
> #end
> 
> I get an error, "Parse Error: Expected 'array initializer element',
> macro identifier found instead".
> 
> What am I doing incorrectly? Thanks.

In a nutshell, POV-Ray doesn't like anything fancy in array initializers
- no macros, no #for loops, no #if statements, no nothing.

That's a long-standing featuroid, which a certain previous member of the
dev team would probably dismiss as entirely intentional; I for one would
call it a shortcoming that /should/ be fixed, but I'd rather not touch
the professional-league Jenga tower of code in which this issue is rooted.

https://youtu.be/7erl-bOWmOM


Post a reply to this message

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