POV-Ray : Newsgroups : povray.newusers : #fopen and #read troubles Server Time
29 Nov 2024 06:49:11 EST (-0500)
  #fopen and #read troubles (Message 1 to 4 of 4)  
From: david sharp
Subject: #fopen and #read troubles
Date: 22 Feb 1999 13:08:00
Message: <36D19BA3.7A40@interport.net>
I am having a hard time getting 
#fopen/#read in version 3.1a, MS-DOS,
to work like I expect.

Can anybody take the time to tell me
what is wrong with the following? 


My scene file looks like this:
==============================
#declare R0=4;
#declare n=0; 

#fopen PathFile "8_2_11a.dat" read
union{
  
  
  #while (defined(PathFile))

    #read (PathFile, xx, yy, zz)
    
    sphere{<xx,yy,zz>,R0}

    #declare n=n+1;
  #end

  texture{Path0_tex}
}

#fclose(PathFile)

==================================

the file 8_2_11.dat looks like this:
=======================================
33.233795,-89.718941,32.003906,
69.594879,7.195656,-8.293076,
-50.495758,101.845917,-35.317207,
-80.023605,68.077423,-19.941116,
-5.417503,16.675690,-6.008537,
8.868011,30.237213,-12.376640,
2.900688,23.989487,-88.818932,
60.252716,79.018677,-35.281281,
24.128769,107.299164,-43.336853,
6.070969,89.397400,-34.994446,
12.038376,95.645020,41.448578,
-20.985031,62.907074,56.705780,
-32.920090,50.411514,-96.181236,
-86.662827,-2.535072,7.846359
=================================

I am consistently getting this error message
from POVRay (3.1a, MSDOS):
=========================
  #while
(defined(PathFile))                                                  
    #read
(PathFile,xx20                                                      
 33.233795,yy,
<----ERROR                                                     
 8_2_11a.dat:2: error: float, vector, or string literal expected
 but ,  found instead. 

=======================


Post a reply to this message

From: Rudy Velthuis
Subject: Re: #fopen and #read troubles
Date: 22 Feb 1999 18:36:46
Message: <36d1ea0e.0@news.povray.org>
david sharp schrieb in Nachricht <36D### [at] interportnet>...
>I am having a hard time getting
>#fopen/#read in version 3.1a, MS-DOS,
>to work like I expect.

[...snip...]

>-86.662827,-2.535072,7.846359
>=================================
>
>I am consistently getting this error message
>from POVRay (3.1a, MSDOS):

><----ERROR
> 8_2_11a.dat:2: error: float, vector, or string literal expected
> but ,  found instead.

 POV-Ray is propably right. It propably expects to see values which are not
separated by commas in your .dat file. I haven't tried this, but could this
be the matter?

--
Rudy Velthuis


Post a reply to this message

From: david sharp
Subject: Re: #fopen and #read troubles
Date: 22 Feb 1999 20:31:54
Message: <36D203B4.808@interport.net>
Rudy Velthuis wrote:
> [...snip...]
> 
> >-86.662827,-2.535072,7.846359
> >=================================
> >
> >I am consistently getting this error message
> >from POVRay (3.1a, MSDOS):
> 
> ><----ERROR
> > 8_2_11a.dat:2: error: float, vector, or string literal expected
> > but ,  found instead.
> 
>  POV-Ray is propably right. It propably expects to see values which are 
> not separated by commas in your .dat file. I haven't tried this, but 
> could this be the matter?

i have tried replacing the commas with spaces and, amazingly 
(ironically?) getting the same error message. Anyway, the way
i read the docs, they specifically say fields in the data
should be separated by commas.


Post a reply to this message

From: david sharp
Subject: Re: #fopen and #read troubles
Date: 22 Feb 1999 23:17:02
Message: <36D22A67.668@interport.net>
david sharp wrote:
 
> i have tried replacing the commas with spaces and, amazingly
> (ironically?) getting the same error message. Anyway, the way
> i read the docs, they specifically say fields in the data
> should be separated by commas.

heh. The code I posted worked after changing the filename for the
data. I think this is because the file I thought I was playing with
(putting in commas, removing them, etc) was a different file from the 
one #read was reading. 
Kind of humiliating, I must say


Post a reply to this message

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