POV-Ray : Newsgroups : povray.general : #ifdef fails? : Re: #ifdef fails? Server Time
29 Jul 2024 06:21:00 EDT (-0400)
  Re: #ifdef fails?  
From: Thomas de Groot
Date: 18 Nov 2012 03:16:30
Message: <50a8995e$1@news.povray.org>
On 17-11-2012 20:22, Ger wrote:
> Consider then following code;
>
>      #fopen FN FileName read
>      #ifdef (FN)
>        #while (defined(FN))
> 	#read ( FN , Vector)
> 	action( Vector )
>        #end
>      #end
>
> After processing Filename001 - FileName100, the next file doesn't exist
> (FileName101). Afaik #ifdef (FN) should catch that and not allow the #while
> loop to continue.
>
> Or am I missing something?
>

I wonder: shouldn't #fopen not give a parse error message when trying to 
open a non-existing file? Before even #ifdef()?

I remember having misquoted a filename and having the parser abort.

[quote]You may use #ifdef FILE_HANDLE_IDENTIFIER to see if a file is 
open[unquote] only tests if the file is /open/ not if it /exists/. That 
might be a subtle difference...

Thomas


Post a reply to this message

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