Hi,
Based on your original request...
>Hi
>
>I have the following code :
>
>output1: %output1.tmp
>output2: %output2.tmp
>output3: %output3.tmp
>
>if exists? output1 [ delete output1 ]
>if exists? output2 [ delete output2 ]
>if exists? output3 [ delete output3 ]
you can try the following line (
Hi Richard,
How about:
outputs: [%output1.tmp %output3.tmp %output3.tmp]
foreach file outputs [
if exists? file [
delete file
]
]
Then you can also access them as outputs/1, etc. if you want.
--Gregg
I have the following code :
output1: %output1.tmp
output2: %output2.tmp
ou
Hi, Richard,
COFFRE Richard FTO wrote:
>
> >
> >I want to simplify it like this :
> >
> >for i 1 3 1 [
> > output(i): %output(i).tmp
> > if exists? output(i) [ delete output(i) ]
> >]
> >
>
> for i 1 3 1 [
>if exists? file: join %output reduce [i ".tmp"] [delete file]
> ]
>
Instead of
Hi, Richard,
Just for the sake of variety...
COFFRE Richard FTO wrote:
>
> >
> >I want to simplify it like this :
> >
> >for i 1 3 1 [
> > output(i): %output(i).tmp
> > if exists? output(i) [ delete output(i) ]
> >]
> >
>
> for i 1 3 1 [
>if exists? file: join %output reduce [i ".tmp"]
Bonjour COFFRE,
Thursday, April 18, 2002, 12:01:12 PM, vous avez écrit:
CRF> Hi
CRF> I have the following code :
CRF> output1: %output1.tmp
CRF> output2: %output2.tmp
CRF> output3: %output3.tmp
CRF> if exists? output1 [ delete output1 ]
CRF> if exists? output2 [ delete output2 ]
CRF> if exist
Hi Richard,
I saw the solutions based on looping with a variable. They work just fine.
But based on your signature line "Share what you know, learn what you
don't", you might be interested in these comments:
One of the things that I think Carl S was recommending is to not use
strings when raw d
Good, thanks Petr
-Message d'origine-
De : Petr Krenzelok [mailto:[EMAIL PROTECTED]]
Envoyé : jeudi 18 avril 2002 13:10
À : [EMAIL PROTECTED]
Objet : [REBOL] Re: For loop and dynamic variable
COFFRE Richard FTO wrote:
>Hi
>
>I have the following code :
>
>o
COFFRE Richard FTO wrote:
>Hi
>
>I have the following code :
>
>output1: %output1.tmp
>output2: %output2.tmp
>output3: %output3.tmp
>
>if exists? output1 [ delete output1 ]
>if exists? output2 [ delete output2 ]
>if exists? output3 [ delete output3 ]
>
>I want to simplify it like this :
>
>for i
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? outp
Bonjour,
Nos amis anglais appellent ça un ""oneliner" :
for i 1 3 1 [ if exists? f: to-file rejoin ["output" i ".tmp"][delete f]]
Patrick
- Original Message -
From: "COFFRE Richard FTO" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 18, 2002 12:01 PM
Subject: [REBOL
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 fi
11 matches
Mail list logo