|
|
Hi Folks,
I've been trying to read in a text file and can
make no sense of the end results
Create a file named text.txt and put the following into it
-------------BEGIN-----------
"line1"
"line2"
"line3"
"line4"
"line5"
"line6"
-------------END-----------
and then run this code within a scene file (.pov)
-------------BEGIN-----------
#debug "\n--------------------\n"
#declare Lines=0;
#fopen Io "text.txt" read
#while ( defined(Io) )
#read (Io,Pat)
#if ( defined(Io) )
#debug Pat
#debug "\n"
#declare Lines=Lines+1;
#end
#end
#fclose
#debug str(Lines,0,0)
#debug " Lines read"
#debug "\n--------------------\n"
-------------END-----------
My results of running above code gives
-------------BEGIN-----------
line1
line3
line5
3 Lines read
-------------END-----------
The results are the same for line termination being LF's or CR/LF's
Baffled
--
(MIKA) Marc Champagne
marcch.AT.videotron.DOT.ca
Montreal, CANADA
Post a reply to this message
|
|