saving blocks--typo correction-excuse me
[1/5] from: sharriff:aina:med-iq at: 26-Sep-2000 10:38
Sorry for the typo!
I meant:
Hi guys!
Can any Rebol Guru tell me how to save values captured from a HTML form
with REBOL
CGI as a block to a text file?
Sharriff Aina
med.iq information & quality in healthcare AG
Gutenbergstr. 42
41564 Kaarst
tel.: 02131-3669-0
fax: 02131-3669-599
www.med-iq.de
[2/5] from: al::bri::xtra::co::nz at: 26-Sep-2000 21:51
> Can any Rebol Guru tell me how to save values captured from a HTML form
with REBOL CGI as a block to a text file?
>> save %block.txt block
>> print read %block.txt
[["one" "two" "three"]]
>>
Andrew Martin
Look out! Rebol fan! :-)
ICQ: 26227169
http://members.nbci.com/AndrewMartin/
http://members.xoom.com/AndrewMartin/
[3/5] from: sharriff:aina:med-iq at: 26-Sep-2000 11:43
can I just do a READ instead of an OPENT to append another BLOCK to
block.txt? I´m grinning from ear to ear now...
Thanks and best regards
Sharriff Aina
med.iq information & quality in healthcare AG
Gutenbergstr. 42
41564 Kaarst
tel.: 02131-3669-0
fax: 02131-3669-599
www.med-iq.de
[4/5] from: joel:neely:fedex at: 26-Sep-2000 8:39
Hi, Sharriff!
[Sharriff--Aina--med-iq--de] wrote:
> can I just do a READ instead of an OPENT to append another BLOCK to
> block.txt? I´m grinning from ear to ear now...
>
Consider the following:
>> ? write
USAGE:
WRITE destination value /binary /string /direct /append /wait
/lines /part size /with end-of-line /allow access /mode args
/custom params
DESCRIPTION:
Writes to a file, url, or port-spec (block or object).
WRITE is a native value.
ARGUMENTS:
destination -- (Type: file url object block)
value -- (Type: any)
REFINEMENTS:
...[snip]...
/append -- Writes to the end of an existing file.
...[sip]...
and the transcript:
>> foo: [1 2 "buckle" "my" "shoe"]
== [1 2 "buckle" "my" "shoe"]
>> mold foo
== {[1 2 "buckle" "my" "shoe"]}
>> write/append %test.data mold foo
>> foo: [3 4 "shut" "the" "door"]
>> write/append %test.data mold foo
>> print read %test.data
[1 2 "buckle" "my" "shoe"][3 4 "shut" "the" "door"]
>>
And, of course, had I not been too lazy to put newlines after each,
you'd be able to say
all-foo: read/lines %test.data
and get a block of strings, each of which can be turned into a
block.
There's more that could be said, but I hope this helps...
-jn-
[5/5] from: sharriff:aina:med-iq at: 26-Sep-2000 16:05
Thanks Mr. Neely!
wow, thanks "Rebolers" for helping out !
Sharriff Aina
med.iq information & quality in healthcare AG
Gutenbergstr. 42
41564 Kaarst
tel.: 02131-3669-0
fax: 02131-3669-599
www.med-iq.de