Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: For loop and dynamic variable

From: richard:coffre:francetelecom at: 18-Apr-2002 13:43

Good, thanks Petr -----Message d'origine----- De : Petr Krenzelok [mailto:[petr--krenzelok--trz--cz]] Envoy=E9 : jeudi 18 avril 2002 13:10 =C0 : [rebol-list--rebol--com] Objet : [REBOL] Re: For loop and dynamic variable 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 1 3 1 [ > output(i): %output(i).tmp > if exists? output(i) [ delete output(i) ] >] >
for i 1 3 1 [ set to-word join 'output i f: join %output reduce [i ".tmp"] if exists? f [delete f] ] ... but that's not probably the cleanes solution anyway.... :-) for i 1 3 1 [if exists? file: join %output reduce [i ".tmp"] [delete file] ] .... a shorter one :-) -pekr-