|
![](/i/fill.gif) |
Am 17.11.2012 20:22, schrieb Ger:
> 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.
Well, if FN is undefined, the #while loop itself should refuse to run
even a single time, so the #ifdef is redundant.
But if the file doesn't exist, #fopen doesn't fail with an undefined FN,
but rather with an error message.
You might want to use the following code:
#if (file_exists(FileName))
#fopen ...
#while ...
...
#end
#end
Post a reply to this message
|
![](/i/fill.gif) |