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
|