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

Evaluation and writing in a file

 [1/13] from: richard:coffre:francetelecom at: 15-Apr-2002 15:56


Hi Rebol fellows, I use to code below to write something in a file : write/append/lines output reduce [ count " - " ligne ] where count is a number and ligne a character string. It doesn't work because I don't have any block, but when I write write/append/lines output [ count " - " ligne ] count isn't evaluated so how can I do ? So far, I split it in 3 instructions. Any ideas ? TIA Richard Coffre France Telecom Orbiscom T=E9l. : 01 47 61 46 28

 [2/13] from: greggirwin:mindspring at: 15-Apr-2002 10:21


Hi Richard, << write/append/lines output reduce [ count " - " ligne ] where count is a number and ligne a character string. It doesn't work because I don't have any block, but when I write write/append/lines output [ count " - " ligne ] count isn't evaluated so how can I do ?
>>
Have you tried COMPOSE? E.g. write/append/lines output compose [ (count) " - " ligne ] --Gregg

 [3/13] from: tomc:darkwing:uoregon at: 15-Apr-2002 10:02


not tried but I would try and reduce the problem... write/append/lines output reduce [ count " - " ligne ] tom On Mon, 15 Apr 2002, COFFRE Richard FTO wrote:

 [4/13] from: richard:coffre:francetelecom at: 16-Apr-2002 9:43


Hi Tom, I have tried it but it failed -----Message d'origine----- De : Tom Conlin [mailto:[tomc--darkwing--uoregon--edu]] Envoy=E9 : lundi 15 avril 2002 19:02 =C0 : [rebol-list--rebol--com] Objet : [REBOL] Re: Evaluation and writing in a file not tried but I would try and reduce the problem... write/append/lines output reduce [ count " - " ligne ] tom On Mon, 15 Apr 2002, COFFRE Richard FTO wrote:

 [5/13] from: richard:coffre:francetelecom at: 16-Apr-2002 9:45


Hi Gregg, It failed in my case as you can see below : ** Script Error: Expected block of lines ** Near: write/append/lines output compose [(count) " - " ligne] :-( -----Message d'origine----- De : Gregg Irwin [mailto:[greggirwin--mindspring--com]] Envoy=E9 : lundi 15 avril 2002 18:21 =C0 : [rebol-list--rebol--com] Objet : [REBOL] Re: Evaluation and writing in a file Hi Richard, << write/append/lines output reduce [ count " - " ligne ] where count is a number and ligne a character string. It doesn't work because I don't have any block, but when I write write/append/lines output [ count " - " ligne ] count isn't evaluated so how can I do ?
>>
Have you tried COMPOSE? E.g. write/append/lines output compose [ (count) " - " ligne ] --Gregg

 [6/13] from: ronald:free at: 16-Apr-2002 10:29


Bonjour COFFRE, Monday, April 15, 2002, 3:56:09 PM, vous avez écrit: CRF> Hi Rebol fellows, CRF> I use to code below to write something in a file : CRF> write/append/lines output reduce [ count " - " ligne ] CRF> where count is a number and ligne a character string. It doesn't work CRF> because I don't have any block, but when I write CRF> write/append/lines output [ count " - " ligne ] CRF> count isn't evaluated so how can I do ? CRF> So far, I split it in 3 instructions. CRF> Any ideas ? CRF> TIA CRF> Richard Coffre CRF> France Telecom Orbiscom CRF> Tél. : 01 47 61 46 28 CRF> -- CRF> To unsubscribe from this list, please send an email to CRF> [rebol-request--rebol--com] with "unsubscribe" in the CRF> subject, without the quotes. write/append/lines output reform [count " - " ligne] should make it HIH -- Cordialement, Ronald

 [7/13] from: richard::coffre::francetelecom::com at: 16-Apr-2002 13:34


One more thing, when I use reform or some other functions, it adds some extra spaces before and after, e.g. with write/append/lines output reform ["Etude du fichier '" file "'"] I have Etude du fichier ' generic4.txt ' What can I do to avoid the extra space insertion ? TIA -----Message d'origine----- De : Ronald Gruss [mailto:[ronald--free--fr]] Envoy=E9 : mardi 16 avril 2002 10:30 =C0 : COFFRE Richard FTO Objet : [REBOL] Re: Evaluation and writing in a file Bonjour COFFRE, Monday, April 15, 2002, 3:56:09 PM, vous avez =E9crit: CRF> Hi Rebol fellows, CRF> I use to code below to write something in a file : CRF> write/append/lines output reduce [ count " - " ligne ] CRF> where count is a number and ligne a character string. It doesn't work CRF> because I don't have any block, but when I write CRF> write/append/lines output [ count " - " ligne ] CRF> count isn't evaluated so how can I do ? CRF> So far, I split it in 3 instructions. CRF> Any ideas ? CRF> TIA CRF> Richard Coffre CRF> France Telecom Orbiscom CRF> T=E9l. : 01 47 61 46 28 CRF> -- CRF> To unsubscribe from this list, please send an email to CRF> [rebol-request--rebol--com] with "unsubscribe" in the CRF> subject, without the quotes. write/append/lines output reform [count " - " ligne] should make it HIH -- Cordialement, Ronald

 [8/13] from: lmecir:mbox:vol:cz at: 16-Apr-2002 13:45


Hi Richard, I have got no idea, what you want to achieve. That said, here is a piece of code, that doesn't fail: write/append/lines output rejoin [count " - " ligne] Cheers L ----- Original Message ----- Subject: [REBOL] Re: Evaluation and writing in a file Hi Gregg, It failed in my case as you can see below : ** Script Error: Expected block of lines ** Near: write/append/lines output compose [(count) " - " ligne] :-(

 [9/13] from: richard:coffre:francetelecom at: 16-Apr-2002 13:28


And the winner is Ronald. Thanks you, it works fine. -----Message d'origine----- De : Ronald Gruss [mailto:[ronald--free--fr]] Envoy=E9 : mardi 16 avril 2002 10:30 =C0 : COFFRE Richard FTO Objet : [REBOL] Re: Evaluation and writing in a file Bonjour COFFRE, Monday, April 15, 2002, 3:56:09 PM, vous avez =E9crit: CRF> Hi Rebol fellows, CRF> I use to code below to write something in a file : CRF> write/append/lines output reduce [ count " - " ligne ] CRF> where count is a number and ligne a character string. It doesn't work CRF> because I don't have any block, but when I write CRF> write/append/lines output [ count " - " ligne ] CRF> count isn't evaluated so how can I do ? CRF> So far, I split it in 3 instructions. CRF> Any ideas ? CRF> TIA CRF> Richard Coffre CRF> France Telecom Orbiscom CRF> T=E9l. : 01 47 61 46 28 CRF> -- CRF> To unsubscribe from this list, please send an email to CRF> [rebol-request--rebol--com] with "unsubscribe" in the CRF> subject, without the quotes. write/append/lines output reform [count " - " ligne] should make it HIH -- Cordialement, Ronald

 [10/13] from: gscottjones:mchsi at: 16-Apr-2002 8:56


Hi, Richard, << From: "COFFRE Richard FTO"
<snip>
I use to code below to write something in a file : write/append/lines output reduce [ count " - " ligne ] where count is a number and ligne a character string. It doesn't work because I don't have any block, but when I write write/append/lines output [ count " - " ligne ] count isn't evaluated so how can I do ?
>>
I apologize in advance if I missed some critical piece of this thread. I also am not entirely sure that I understand the final format of which you seek. Assuming, for example, : ;if count: 3 ligne: "I don't know French" ;then write/append/lines output rejoin [ count " - " ligne ] ;should produce ;3 - I don't know French ;in the file referred to by 'output If you are looking for a different final format, please give an example of what you wish to see.. Hope this helps, and good luck. --Scott Jones

 [11/13] from: ronald:free at: 16-Apr-2002 16:57


write/append/lines output rejoin ["Etude du fichier '" file "'"] makes the job !! -- Cheers, Ronald

 [12/13] from: tomc:darkwing:uoregon at: 16-Apr-2002 10:21


rejoin does work
>> lines: {line1 line2 line3 line4 line5}
== "line1 line2 line3 line4 line5"
>> count: 0
== 0
>> output: %out.dat
== %out.dat
>> write output "" >> foreach line parse lines none [
[ write/append/lines output rejoin[ count: count + 1 " - " line ] [ ]
>> print read %out.dat
1 - line1 2 - line2 3 - line3 4 - line4 5 - line5 On Tue, 16 Apr 2002, COFFRE Richard FTO wrote:

 [13/13] from: richard:coffre:francetelecom at: 17-Apr-2002 10:35


Ok Tom, I'll try once again -----Message d'origine----- De : Tom Conlin [mailto:[tomc--darkwing--uoregon--edu]] Envoy=E9 : mardi 16 avril 2002 19:21 =C0 : [rebol-list--rebol--com] Objet : [REBOL] Re: Evaluation and writing in a file rejoin does work
>> lines: {line1 line2 line3 line4 line5}
== "line1 line2 line3 line4 line5"
>> count: 0
== 0
>> output: %out.dat
== %out.dat
>> write output "" >> foreach line parse lines none [
[ write/append/lines output rejoin[ count: count + 1 " - " line ] [ ]
>> print read %out.dat
1 - line1 2 - line2 3 - line3 4 - line4 5 - line5 On Tue, 16 Apr 2002, COFFRE Richard FTO wrote: