POV-Ray : Newsgroups : povray.beta-test : file input - doc bug, i/o bug or tom bug? Server Time
30 Jul 2024 12:26:51 EDT (-0400)
  file input - doc bug, i/o bug or tom bug? (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: Tom Melly
Subject: file input - doc bug, i/o bug or tom bug?
Date: 4 Jan 2002 09:05:31
Message: <3c35b6ab@news.povray.org>
According to the docs (6.2.3.4)
"hello", 1,2
ought to be a valid input line from a file (string, float, float)

However, this generates an error, which is fixed by:
"hello", 1,2,
(requires final comma)

2.5.beta9.icl.win32
running Win2000, P3 733
--
#macro G(D,E,F)#local I=array[3]{D,E,F}#local B=0;triangle{#while(
B<3)#while(I[B])A[mod(I[B],10)]+#local I[B]=div(I[B],10);#end<-5,-
2,9>#local B=B+1;#end}#end #local A=array[7]{x,x*2,x*4,y,y*2,y*4,z
}light_source{-x*6-z*9,1}mesh{G(105,10,146)G(105,246,10)G(105,56,
146)G(105,1256,246)G(1256,126,220)G(22156,2216,201)pigment{rgb 1}}//TM


Post a reply to this message

From:
Subject: Re: file input - doc bug, i/o bug or tom bug?
Date: 4 Jan 2002 09:16:41
Message: <12eb3usbtoehrsumk43ejs5h203dbl4gh7@4ax.com>
On Fri, 4 Jan 2002 14:05:30 -0000, "Tom Melly" <tom### [at] tomandlucouk> wrote:
> According to the docs (6.2.3.4)  "hello", 1,2 ought to be a valid input line from a
file (string, float, float)
> However, this generates an error, which is fixed by: "hello", 1,2, (requires final
comma)

works according to doc for me

do you read in loop ? perhaps there is one extra reading according to your while
condition

check this source

#fopen wfile "nothing.txt" write
#write( wfile , chr(34) , "hello" , chr(34) , ",1,2" )
#undef wfile
#fopen wfile "nothing.txt" read
#read( wfile , S, F1,F2 )
#warning S
#warning str(F1,0,0)
#warning str(F2,0,0)

> 2.5.beta9.icl.win32

please upgrade to 3.5 ;-)

ABX


Post a reply to this message

From: Tom Melly
Subject: Re: file input - doc bug, i/o bug or tom bug?
Date: 4 Jan 2002 09:28:38
Message: <3c35bc16$1@news.povray.org>

news:12eb3usbtoehrsumk43ejs5h203dbl4gh7@4ax.com...
>
> works according to doc for me
>
> do you read in loop ? perhaps there is one extra reading according to your
while
> condition
>
> check this source
>

Hmm, that's okay, but this version fails without a comma (e.g. ",1,2,\n")

#fopen wfile "nothing.txt" write
#write( wfile , chr(34) , "hello" , chr(34) , ",1,2\n" ) /* bad */
/* #write( wfile , chr(34) , "hello" , chr(34) , ",1,2,\n" )*/ /* good */
#write( wfile , chr(34) , "hello" , chr(34) , ",1,2" )
#undef wfile
#fopen wfile "nothing.txt" read
#read( wfile , S, F1,F2 )
#warning S
#warning str(F1,0,0)
#warning str(F2,0,0)
#read( wfile , S, F1,F2 )
#warning S
#warning str(F1,0,0)
#warning str(F2,0,0)


Post a reply to this message

From: Michael Andrews
Subject: Re: file input - doc bug, i/o bug or tom bug?
Date: 7 Jan 2002 05:35:10
Message: <3C397B3D.8070702@reading.ac.uk>
Hi Tom,

Tom Melly wrote:

> Hmm, that's okay, but this version fails without a comma (e.g. ",1,2,\n")
> 
This is because a line-feed is not counted as an item separator, only commas are.


Bye for now,
	Mike Andrews.


Post a reply to this message

From:
Subject: Re: file input - doc bug, i/o bug or tom bug?
Date: 7 Jan 2002 05:53:10
Message: <pbvi3uomd9n7427fp390jbr9mpvmsqjutg@4ax.com>
On Mon, 07 Jan 2002 10:41:01 +0000, Michael Andrews <M.C### [at] readingacuk>
wrote:
> > Hmm, that's okay, but this version fails without a comma (e.g. ",1,2,\n")
> 
> This is because a line-feed is not counted as an item separator, only commas are.

But why you need separator after third component when you end reading at this
third component ? "\n" is only white space.

ABX


Post a reply to this message

From: Tom Melly
Subject: Re: file input - doc bug, i/o bug or tom bug?
Date: 8 Jan 2002 05:20:36
Message: <3c3ac7f4$1@news.povray.org>
"Michael Andrews" <M.C### [at] readingacuk> wrote in message
news:3C3### [at] readingacuk...
> Hi Tom,
>
> Tom Melly wrote:
>
> > Hmm, that's okay, but this version fails without a comma (e.g. ",1,2,\n")
> >
> This is because a line-feed is not counted as an item separator, only commas
are.
>

Hmm, yes I realise that - all I can say is that I have never come across a
scripting lang. that behaves in this way. Could someone confirm that this is the
way that POV is meant to behave. If it is, then I would suggest some
clarification in the docs, since this will confuse Perl users for a start....


Post a reply to this message

From: Tom Melly
Subject: Re: file input - doc bug, i/o bug or tom bug?
Date: 8 Jan 2002 05:22:25
Message: <3c3ac861@news.povray.org>

news:pbvi3uomd9n7427fp390jbr9mpvmsqjutg@4ax.com...
>
> But why you need separator after third component when you end reading at this
> third component ? "\n" is only white space.
>

It would appear that in some ways POV is behaving as though it is globbing the
whole input file in one operation, and yet it isn't. Could someone confirm that
this is the intended behaviour?


Post a reply to this message

From: Tom Melly
Subject: Re: file input - doc bug, i/o bug or tom bug?
Date: 10 Jan 2002 05:25:33
Message: <3c3d6c1d$1@news.povray.org>
"Tom Melly" <tom### [at] tomandlucouk> wrote in message
news:3c3ac7f4$1@news.povray.org...

<snip>

Hmm, no further comment. Anyone want to confirm whether this is a bug or not?


Post a reply to this message

From: Michael Andrews
Subject: Re: file input - doc bug, i/o bug or tom bug?
Date: 10 Jan 2002 08:52:20
Message: <3C3D9E00.9040808@reading.ac.uk>
Hi Tom,

Tom Melly wrote:

> 
> Hmm, no further comment. Anyone want to confirm whether this is a bug or not?
> 

Well, it seems to be doing exactly as it should, to me.

Outputting lines 3 & 4 of your test code 'nothing.txt' is

"hello",1,2,
"hello",1,2

which is read correctly.

With lines 2 & 4 you get

"hello",1,2
"hello",1,2

which causes a parsing error when it tries to read the second "hello" 
because it is not preceded by a comma.

So IMHO this works as given in the documentation (ss6.2.3.3).

Bye for now,
	Mike Andrews.


Post a reply to this message

From:
Subject: Re: file input - doc bug, i/o bug or tom bug?
Date: 10 Jan 2002 09:09:27
Message: <508r3u40rqiiutrm7bpg10rrtm1um9nejj@4ax.com>
On Thu, 10 Jan 2002 13:58:24 +0000, Michael Andrews <M.C### [at] readingacuk>
wrote:
> So IMHO this works as given in the documentation (ss6.2.3.3).

I have rechecked all scripts from this thread and all works for me as expected,
but I remember there was something wrong imo.

Btw: there is general rule that commas are optional but it probably applies only
to script.

ABX


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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