POV-Ray : Newsgroups : povray.programming : File load failure Server Time
1 Jul 2024 06:49:58 EDT (-0400)
  File load failure (Message 1 to 8 of 8)  
From: AngleWyrm
Subject: File load failure
Date: 28 Jan 2004 07:56:19
Message: <4017b173$1@news.povray.org>
So I'm trying to load a datafile that consists of about 10,000 lines of
three values each. BUT the program only seems to load between 4,880 and
4,998 or so. Do you see anything wrong with this loading routine, or is it
my data/computer?

//////////////////////////////////////////////////////////
// Load the data file
//
#fopen dataFile "d:/docs/raytracing/redshiftData.txt" read

#declare LinesInFile = 10000;
#declare celestialData = array[3][ LinesInFile ];

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

    #declare rightAscentionAsDegrees = 0.0;
    #declare declinationAsDegrees = 0.0;
    #declare zVal = 0.0;

    #read( dataFile, rightAscentionAsDegrees, declinationAsDegrees, zVal )

    #declare celestialData[0][i] = rightAscentionAsDegrees;
    #declare celestialData[1][i] = declinationAsDegrees;
    #declare celestialData[2][i] = zVal;

    #declare i = i+1;
#end
    #debug concat( "\n\nTotal values read from file: ", str(i,5,0), "\n\n" )
#fclose dataFile


Post a reply to this message

From: ABX
Subject: Re: File load failure
Date: 28 Jan 2004 08:02:56
Message: <bdcf109sts7q38t26ge9fi3f5pash3m8v1@4ax.com>
On Wed, 28 Jan 2004 04:56:06 -0800, "AngleWyrm"
<no_### [at] hotmailcom> wrote:
> So I'm trying to load a datafile that consists of about 10,000 lines of
> three values each.

In form
  a,b,c
  d,e,f
or
  a,b,c,
  d,e,f
?

Note that in case of:
  1,2,3
 -2,4,5
there are in fact only 5 values
  1,2,3-2,4,5

BTW: this group is not for discussing SDL, see:
http://news.povray.org/povray.programming/34391/

ABX


Post a reply to this message

From: ingo
Subject: Re: File load failure
Date: 28 Jan 2004 08:05:50
Message: <Xns947E8F67634E3seed7@news.povray.org>
in news:4017b173$1@news.povray.org AngleWyrm wrote:

> or is it my data

Make shure that there are no commas missing in your data.


BTW, the povray-programming group is for discussing the sourcecode of POV-
Ray, not for scene code. povray.general would have been the appropriate 
group to post this question.

Ingo


Post a reply to this message

From: AngleWyrm
Subject: Re: File load failure
Date: 30 Jan 2004 12:50:15
Message: <401a9957$1@news.povray.org>
"ingo" <ing### [at] tagpovrayorg> wrote in message
news:Xns947E8F67634E3seed7@news.povray.org...
> in news:4017b173$1@news.povray.org AngleWyrm wrote:
> > or is it my data

> Make shure that there are no commas missing in your data.
>
> BTW, the povray-programming group is for discussing the sourcecode of POV-
> Ray, not for scene code. povray.general would have been the appropriate
> group to post this question.

Please re-examine that assessment:

As it turns out the problem was what could be construed as *between* the
code and the data. The tool I have for creating Comma Separated text files
(Microsoft Excel) does not append a comma to the end of each line.

I submit that the pov-ray definition of comma-separated files, wherein there
is a comma between every value irrespective of line breaks, is possibly one
or two lines easier to code. However it breaks tradition with data tools in
the marketplace, and causes data to be pre-processed before being suitable
for pov-ray consumption.

The end result is wasted labor on the part of the user, spent reformatting
data. This time could be freed up to persue the projects at hand, an
improvement in the quality of life.

So I would like to recommend a minor improvement to the Pov-Ray code: That
the end-of-line character be recognized as a valid data separator.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: File load failure
Date: 30 Jan 2004 13:59:07
Message: <401aa97b@news.povray.org>
In article <4017b173$1@news.povray.org> , "AngleWyrm" 
<no_### [at] hotmailcom> wrote:

> So I'm trying to load a datafile that consists of about 10,000 lines of
> three values each. BUT the program only seems to load between 4,880 and
> 4,998 or so. Do you see anything wrong with this loading routine, or is it
> my data/computer?

This is the wrong group for this question.  This group is for discussion of
the POV-Ray source code.  General questions about using the POV-Ray scene
description language should be asked in either povray.general or
povray.newusers.

    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: AngleWyrm
Subject: Re: File load failure
Date: 30 Jan 2004 17:48:40
Message: <401adf48$1@news.povray.org>
"Thorsten Froehlich" <tho### [at] trfde> wrote in message
news:401aa97b@news.povray.org...
>
> This is the wrong group for this question.  This group is for discussion
of
> the POV-Ray source code.

It is unfortunate that I phrased the situation in such a manner, but
nevertheless I do believe that the subject material is in fact POV-Ray
source code.

Broken code is not the only definition of a bug, and I believe that a
significant improvement can be had for a very small update.

If you know which source file is responsible for parsing comma delimited
input files, please point me to it, and I will post a cross-platform
compatible version that fixes the issue.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: File load failure
Date: 30 Jan 2004 18:22:58
Message: <401ae752@news.povray.org>
In article <401adf48$1@news.povray.org> , "AngleWyrm" 
<no_### [at] hotmailcom> wrote:

> If you know which source file is responsible for parsing comma delimited
> input files, please point me to it,

The code is in tokenize.cpp, function Parse_Read_Value.

> and I will post a cross-platform
> compatible version that fixes the issue.

You still didn't get what everybody has been telling you all along:  There
is nothing to fix!  This is not a bug.  POV-Ray behaves exactly as designed
and documented.  Just because you don't like that design does not make it
something that needs fixing!

    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: AngleWyrm
Subject: Re: File load failure
Date: 30 Jan 2004 18:48:25
Message: <401aed49$1@news.povray.org>
"Thorsten Froehlich" <tho### [at] trfde> wrote in message
news:401ae752@news.povray.org...
> In article <401adf48$1@news.povray.org> , "AngleWyrm"
> <no_### [at] hotmailcom> wrote:
>
> > If you know which source file is responsible for parsing comma delimited
> > input files, please point me to it,
>
> The code is in tokenize.cpp, function Parse_Read_Value.
>
thanks

> You still didn't get what everybody has been telling you all along:  There
> is nothing to fix!  This is not a bug.  POV-Ray behaves exactly as
designed
> and documented.  Just because you don't like that design does not make it
> something that needs fixing!

This is true, it works as advertized, as designed, and there is not a
behavior that differs from the documentation. I am not complaining about
quality, or pointing out a bug in the code. If I have offended anyone then I
am sorry; a lot of work has been done on this code over the years, and that
deserves every respect.


Post a reply to this message

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