POV-Ray : Newsgroups : povray.general : Syntax for reading a large file of numbers. : Re: Syntax for reading a large file of numbers. Server Time
31 Jul 2024 10:22:23 EDT (-0400)
  Re: Syntax for reading a large file of numbers.  
From: Mike Williams
Date: 19 May 2007 15:13:46
Message: <wD0ffAAjx0TGFwd8@econym.demon.co.uk>
Wasn't it gregjohn who wrote:
>Alain <ele### [at] netscapenet> wrote:
>
>> You can do this:
>> #declare My_Array[1000]={#include "Your_text_file.txt"}
>>
>
>Okay.  This syntax works for a short array:
>#declare That_Array=array[5]{1,2,3,4,5}
>
>But for my actual big file, which Notepad2 tells me is 14405 lines long:
>
>#declare My_Array=array[14406]{#include "c:My_Include_File.ppp"}
>
>.... gives me an error message:
>
>"Parse Error: Insufficient number of initializers."  I get that with
>14404,14405, and a quazillion in the []'s.

You could try a very low number which should give you a "No matching }"
error.

As you've seen, if you use a high number, you get "Insufficient number
of initialisers".

You could then try a binary chop to search for the actual number of
entries.


What might be happening is that you've got some negative numbers. POV
treats
        123
        -2
as an expression that evaluates to 121 if there are no commas.

If that's the case, then you can globally replace "-" with ",-" in a
copy of the data file.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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