POV-Ray : Newsgroups : povray.general : a simple question about File I/O : Re: a simple question about File I/O Server Time
4 Aug 2024 06:14:05 EDT (-0400)
  Re: a simple question about File I/O  
From: Mike Williams
Date: 2 Jul 2003 02:54:49
Message: <7+2ixHAlGoA$EwBb@econym.demon.co.uk>
Wasn't it aaaz123456 who wrote:
>I use the following loops to read data ,
>but get a error message,that is "Parse error : Expected ' undeclared
>indentifier' ,empty array found instead"
>Why?
>Thanks a lot .
>
>> #local N=3;  // fill with
>> #local M=3;  // favorite dimensions
>> #local Array=array[N][M];
>> #fopen MyFile "myfile.txt" read
>> #local n=0;
>> #while (n<N)
>>   #local m=0;
>>   #while (m<M)
>>     #read(MyFile,Array[n][m])
>>     #local m=m+1;
>>   #end
>>   #local n=n+1;
>> #end
>> #fclose MyFile
>>

Add this line before the loop and it works

  #local Array[0][0] = 0;

It looks like #read is failing to instantiate the array, so you have to
do it yourself first.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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