POV-Ray : Newsgroups : povray.general : problem reading text from file : problem reading text from file Server Time
29 Jul 2024 20:14:45 EDT (-0400)
  problem reading text from file  
From: stevenvh
Date: 20 Aug 2010 02:30:01
Message: <web.4c6e206e5ce7b402c0721a1d0@news.povray.org>
Hi,
I've got a text file I want to read from:

    "first, second, third"

I want to read the first item ("first") into Var1:

    #fopen MyFile "test.txt" read
    #read (MyFile, Var1)
    #fclose MyFile

When I run this code I get the error"

    "test.txt" line 1: Parse Error: Expected 'float, vector,
    or string literal', undeclared identifier 'first' found instead

Apparently POV-Ray interprets the first data item as an identifier. Is my
understanding of #read wrong?
TIA
Steven


Post a reply to this message

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