POV-Ray : Newsgroups : povray.general : End of data File : End of data File Server Time
3 Aug 2024 06:12:09 EDT (-0400)
  End of data File  
From: Charm Quark
Date: 30 Apr 2004 15:25:00
Message: <web.4092a796964deb46934b17180@news.povray.org>
I am attempting to have povray read in a data file of format 2279
lines, with 8 columns. The file is comma and tab delimited. That is, each
item is followed by a comma, and then a tab.
     For some reason, povray is not detecting the end of the file, and is
going on to attempt to read in data past the end of the file, upon which it
then crashes, quitting. I don't know if this is a bug in the program, or if
I'm doing something wrong. Has anyone else encountered this, or do any of
you know what's going on?
     I post below the offending code.

#fopen dataFile "3_Center_RA_Dec_cz_Shell_80th_POV.txt" read
#fopen debugFile "debug.txt" write

#declare LinesInFile = 2279;
#declare pointsData = array[3][LinesInFile]

#declare i = 0;
#while ( defined(dataFile) )

 #declare x1 = 0.0;
 #declare x2 = 0.0;
 #declare x3 = 0.0;
 #declare RA = 0.0;
 #declare Dec = 0.0;
 #declare cz = 0.0;
 #declare r = 0.0;
 #declare mag = 0.0;

 #read( dataFile, x1,x2,x3,RA,Dec,cz,r,mag)

 #declare i = i + 1;

#end

#debug concat( "nnTotal values read from file: ", str(i,5,0), "nn" )
#fclose dataFile


Post a reply to this message

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