POV-Ray : Newsgroups : povray.programming : Extending the #read directive : Extending the #read directive Server Time
18 May 2024 07:23:03 EDT (-0400)
  Extending the #read directive  
From: Hugo Asm
Date: 8 May 2003 08:02:25
Message: <3eba4751@news.povray.org>
Hello folks!

This is my first post in this group, and I don't qualify as a C or C++
programmer but I have a suggestion:

The #read directive in POV-Ray follow strict rules, in order to read
variables or strings. I understand why this must be so. But I suggest a new
option that read the content of a text file regardless of the formatting. In
other words, POV-Ray will not try to interpret the file, but only read a
given number of characters into a string. The user can afterwards search the
string for any information they require. Here's an example:


#declare Offset=0; // Start reading at beginning of file
#declare Length=30; // Read 30 characters

#fopen MyFile "mydata.txt" read

   #read_ascii (MyFile, Offset, Length, MyString)

#fclose MyFile



If I wasn't so dumb, I could probably code it myself! I have the Borland C++
builder but not the necessary education. I somehow think it would be easy to
implement the feature, but I'd need a step-by-step guidance, and I don't
expect you to spend time on that. However, the feature would be useful.

Regards,
Hugo


Post a reply to this message

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