POV-Ray : Newsgroups : povray.advanced-users : file reading mistake : Re: file reading mistake Server Time
28 Jul 2024 10:20:34 EDT (-0400)
  Re: file reading mistake  
From: Zarkoff
Date: 28 Jan 2006 13:10:01
Message: <web.43dbb297fd7740418e6dc300@news.povray.org>
"Zarkoff" <zar### [at] yahoocom> wrote:
> Okay, I've probably made another stupid mistake that I'll figure out fifteen
>  minutes after I post this, but at the moment I am utterly baffled and
> clueless.
>
>....
> #declare Rv = array[210]
>
> #declare cnt = 1;
>
> #fopen SplnFile Fname read
>
> // -- #while (cnt < 210) <--- this was commented out to check problem
> #if (defined(SplnFile))
>   #read (SplnFile, tempz)     // this part works
>   #declare Rv[0] = tempz;
>   #declare cnt = cnt + 1;
> //#end
> #end
>

Just like I said, minutes later a soultion occured to me:

#while (defined(SplnFile))    // I still don't know why POV
  #read (SplnFile, tempz)     // expects an undeclared identifier here.
  #declare Rv[cnt-1] = tempz;
  #declare cnt = cnt + 1;
  #undef tempz  // <------ that makes it work
#end

I'd still like to know why the #read statement requires an undeclared
indentifier in this case. I've seen others use declared identifiers -- I
think.

I'm working around a problem I don't understand yet.


Post a reply to this message

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