POV-Ray : Newsgroups : povray.beta-test : uninitialized array element bug : Re: uninitialized array element bug Server Time
29 Jul 2024 14:20:29 EDT (-0400)
  Re: uninitialized array element bug  
From: Thorsten Froehlich
Date: 23 Apr 2002 11:19:28
Message: <3cc57b80@news.povray.org>

Skiba <abx### [at] babilonorg>  wrote:

> I tried to make shorter version of f_array problem script for Warp but
> accidentaly I found another thing:
>
> #declare IC_Arr=array[12]
> #declare IC_Arr[0]=function{x}
> #declare IC_Arr[1]=IC_Arr[0]
> #declare IC_Arr[2]=IC_Arr[1]
>
> returns :
>
> #declare IC_Arr[1]=IC_Arr[0]
> #declare IC_Arr[2]=IC_Arr[1] <----ERROR
> Parse Error: Attempt to access uninitialized array element.
>
> Any confirmation ?

Add semicolons and it works.  The semicolons are required but the parser
cannot detect the end of the third declare line:

 #declare IC_Arr=array[12]
 #declare IC_Arr[0]=function{x}
 #declare IC_Arr[1]=IC_Arr[0];
 #declare IC_Arr[2]=IC_Arr[1]

Gives the correct error message.

 #declare IC_Arr=array[12]
 #declare IC_Arr[0]=function{x}
 #declare IC_Arr[1]=IC_Arr[0];
 #declare IC_Arr[2]=IC_Arr[1];

Gives the correct result.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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