POV-Ray : Newsgroups : povray.beta-test : uninitialized array element bug Server Time
29 Jul 2024 12:28:36 EDT (-0400)
  uninitialized array element bug (Message 1 to 3 of 3)  
From:
Subject: uninitialized array element bug
Date: 23 Apr 2002 11:09:39
Message: <q3uacukhkhhvl0eotuce51snvdjnhpbk8k@4ax.com>
POV 3.5 RC2 icl on WinNT Sp 6 PII 233 with 128 MB

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 ?

ABX


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: uninitialized array element bug
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

From:
Subject: Re: uninitialized array element bug
Date: 23 Apr 2002 11:38:12
Message: <vmvacucjusfhttmsa45adiklud3vjj7n27@4ax.com>
On Tue, 23 Apr 2002 17:19:24 +0200, "Thorsten Froehlich" <tho### [at] trfde>
wrote:
> Add semicolons and it works.  The semicolons are required but the parser
> cannot detect the end of the third declare line.

Somehow I felt such solution but was too concerned on other things. Anyway I
think something could be mentioned in "6.2.2.1  Declaring identifiers" about
such situation.

ABX


Post a reply to this message

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