POV-Ray : Newsgroups : povray.beta-test : the read-directive : Re: the read-directive Server Time
17 May 2024 13:31:42 EDT (-0400)
  Re: the read-directive  
From: Warp
Date: 17 Oct 2012 12:22:24
Message: <507edb40@news.povray.org>
MichaelJF <mi-### [at] t-onlinede> wrote:
> for the first time I tried to use the read-directive and was heavily
> disappointed as I noticed that you can nearly write everything to a file, but
> are very restricted to read from a text-file. If one would have a directive like
> readln in c or c++ which reads a line from a file into a string one could build
> parsers only with the existing string-functions (o.k. some more convient ones
> would be fine, but the existing like strlen, strcmp or concat are enough to
> build macros for text exchanges, substring-detection and so on). So my question
> is simple: Is it possible to implent such a feature without too much effort?

#read was never intended to be a raw byte input stream. Instead, it was
always intended to be used to read comma-separated lists of elements.

(There's a lesser known fact that since #read uses the SDL parser itself
to read the numbers, you can actually embed things like #declares in the
input file and they will be parsed and interpreted properly and
transparently.)

-- 
                                                          - Warp


Post a reply to this message

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