POV-Ray : Newsgroups : povray.bugreports : initialise array from csv file : Re: initialise array from csv file Server Time
19 Apr 2024 22:06:03 EDT (-0400)
  Re: initialise array from csv file  
From: Bald Eagle
Date: 5 Sep 2021 12:40:00
Message: <web.6134f24d551ab7c61f9dae3025979125@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> I am trying to initialise an array via an '#include', as described in clipka's
> message <http://news.povray.org/52dab911%40news.povray.org>.  but, no dice with
> the three versions I tried: v3.8 alpha.9945627 and beta.2, and v3.7.0.8.
>
> the test data:
> $ cat tst.csv
> 1,2,3,4,
> 5,6,7,8,
> 9,10,11,12,
> 13,14,15,16
> $
>
> in the scene I use:
>
> #declare arr_ = array [16] { #include "tst.csv" };
>
> I get two different error messages, v3.7.0.8: "Parse Error: Insufficent number
> of initializers".  and for the v3.8 POV-Ray's: "Parse Error: Expected 'array
> initializer element', # found instead".
>
>
> regards, jr.

I think that just because of the way the parser works, certain implementations
and syntax structures are allowed - and able to be properly recognized/tokenized
and accepted by the parser, and others aren't.

You may have to resort to reading in your csv file with a loop and individually
assigning array elements.

try getting rid of the [16] and see what that gets you.
try your nice little () parsing trick
maybe a macro inside the {} would work

I got tied up with a surprise project, and it's eating up my weekend.


- Bill


Post a reply to this message

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