POV-Ray : Newsgroups : povray.general : Reading from a text file Server Time
29 Jul 2024 14:17:02 EDT (-0400)
  Reading from a text file (Message 11 to 14 of 14)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Bill Pragnell
Subject: Re: Reading from a text file
Date: 6 Jan 2012 06:15:00
Message: <web.4f06d7338e1c2e696dd25f0b0@news.povray.org>
Thomas de Groot <tenDOTlnDOTretniATtoorgedDOTt> wrote:
> It seems to me that arrays are unduly complicated in use here.

Indeed. Although an array would be useful if the positions were to be used
repeatedly. I've had to use #read and arrays like this before.

Bill


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Reading from a text file
Date: 6 Jan 2012 09:20:25
Message: <4f070329@news.povray.org>
Thomas de Groot wrote:
> It seems to me that arrays are unduly complicated in use here. 
> Personally, I would prefer the following:
> 
> #fopen MyFile "myData.txt" read
> #while (defined(MyFile))
>   #read (MyFile,Vector)
> #end

but for this you need a way to specify that a vector
should be read instead of a scalar, either by introducing
typed variables or requiring additional parameters.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Reading from a text file
Date: 6 Jan 2012 10:19:13
Message: <4f0710f1$1@news.povray.org>
On 6-1-2012 15:20, Christian Froeschlin wrote:
> Thomas de Groot wrote:
>> It seems to me that arrays are unduly complicated in use here.
>> Personally, I would prefer the following:
>>
>> #fopen MyFile "myData.txt" read
>> #while (defined(MyFile))
>> #read (MyFile,Vector)
>> #end
>
> but for this you need a way to specify that a vector
> should be read instead of a scalar, either by introducing
> typed variables or requiring additional parameters.
I cannot pretend to know exactly what you mean :-) but in my simple 
vision and use of this, I write and then read a vector (or a float or 
whatever, e.g. text) according to my needs. You only have to take care 
that you use a vector as such or a text as such and not make a 
hotchpotch of things. #read reads and interprets what is between the 
commas: if this is a vector, it reads a vector, etc. doesn't it?

Thomas


Post a reply to this message

From: Scott
Subject: Re: Reading from a text file
Date: 9 Jan 2012 12:40:01
Message: <web.4f0b25c68e1c2e69be8719c80@news.povray.org>
Just wanted to thank Alain and Thomas for those additional comments.

It is very helpful to get this feedback.  It is a great resource.

Thanks so much for taking the time to contribute to this discussion.

scott


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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