Thanks you

-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Envoy� : jeudi 18 avril 2002 12:22
� : [EMAIL PROTECTED]
Objet : [REBOL] Re: For loop and dynamic variable


Richard:

> for i 1 3 1 [
>     output(i): %output(i).tmp
>     if exists? output(i) [ delete output(i) ]
>  ]
>  
>  Any ideas 

I'd write:

for i 1 3 1 [
   file-name: to-file join "output" [i ".tmp"]
  
   if all [exists? file-name 
           not dir? file-name ][
                    delete file-name
          ] ;; if
] ;; for


(I've added a check that the resultant name isn't a directory (folder) just 
because I'd do that in my own code. May be you don't need it in your 
application).

Sunanda.
-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.

Reply via email to