POV-Ray : Newsgroups : povray.general : File I/O : Re: File I/O Server Time
6 Oct 2024 09:07:11 EDT (-0400)
  Re: File I/O  
From: Le Forgeron
Date: 17 Apr 2014 11:54:13
Message: <534ff925$1@news.povray.org>
Le 17/04/2014 17:17, pbrants nous fit lire :
> Here I am again!
> 
> #fopen MyFile "niks.txt" write
>   #declare i=1;
>   #while (i <= 5)
>      #write (MyFile, i,",")
>      #declare i=i+1;
>      #end  // while
>   #fclose Myfile
> 
>   #fopen MyFile "niks.txt" read    // Here parse error!
>   #declare i=1;
>   #while (i <= 5)
>      #read (MyFile, i)
>      #declare i=i+1;
>      #end  // while
>   #fclose Myfile
> 
> This piece of code gives a parse error on the indicated line:
> Cannot read from file niks.txt because the file is open for writing only
> 
> What is wrong here?
> I'm using Windows 7


You closed Myfile, but opened MyFile. Typo! (Camel vs Pascal)


Post a reply to this message

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