POV-Ray : Newsgroups : povray.general : What causes this error? Server Time
16 Nov 2024 05:20:11 EST (-0500)
  What causes this error? (Message 1 to 2 of 2)  
From: Severi Salminen
Subject: What causes this error?
Date: 10 Mar 2004 08:07:34
Message: <404f1316$1@news.povray.org>
Next scene gives an error "Expected 'undeclared identifier', empty array 
found instead" when I try to render it. Aren't A[0] and A[1] undeclared 
identifiers and shouldn't Pov-Ray turn them "into global identifiers of 
the type determined by the data which is read". If I uncomment the 
commented line, it works. What am I missing here and how should I 
correct the code to make it work?

PS. Don't forget to delete the test.dat this scene creates...

Severi S.

-----------------------

#declare A = array[2];

//#declare A[0]=0;

#fopen P_File "test.dat" write
     #write (P_File, 1,",",2)
#fclose P_File

#fopen P_File "test.dat" read
     #read (P_File, A[0],A[1])
#fclose P_File


Post a reply to this message

From: gonzo
Subject: Re: What causes this error?
Date: 11 Mar 2004 01:14:54
Message: <405003de@news.povray.org>
Severi Salminen <sev### [at] NOT_THISsibafi> wrote in message
news:404f1316$1@news.povray.org...
> Next scene gives an error "Expected 'undeclared identifier', empty array
> found instead" when I try to render it. Aren't A[0] and A[1] undeclared
> identifiers and shouldn't Pov-Ray turn them "into global identifiers of
> the type determined by the data which is read".
<snip>

But A[0] & A[1] are declared...
> #declare A = array[2];

And since it is uninitialized, the error is correct.
Try
#fopen P_File "test.dat" read
    #read (P_File, A0,A1)
    #declare A[0] = A0;
     #declare A[1] = A1;
#fclose P_File

RG


Post a reply to this message

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