This method works well...
>> m: error? try [ write %test "test" ]
== false
>> m: error? try [ write test "test" ]
== true

This will elleviate the problem with nothing being returned from write...
>> m: try [ write %test "test" none]
== none

But you will still have to capture the error...
>> m: try [ write test "test" none]
** Script Error: test has no value.
** Where: write test "test" none

I just know how to bottle it up and spit it out later...
>> if error? m: try [ write test "test" none] [ print "error detected!" m ]
error detected!
** Script Error: test has no value.
** Where: write test "test" none

Maybe someone knows how to peel an error! apart?

--Ryan

"Life... Dont talk to me about life."  -A robot named Marvin

[EMAIL PROTECTED] wrote:

> I am writing a script that will try 3 times to write a file and then fail, however, 
>I cant place a try block around the REBOL write statement because it does not return 
>anything upon success, thus I get an error that the word is not bound:
>
> >> m: try [ write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there" ]
> connecting to: 170.16.15.136
> ** User Error: Server error: tcp 530 Login incorrect..
> ** Where: write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there"
> ; -- great: when write fails 'm is bound
> >> m: try [ write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi there" ]
> connecting to: 170.16.15.136
> ** Script Error: m needs a value.
> ** Where: m: try [write ftp://chuck:[EMAIL PROTECTED]/crossing/ndtd/user.r "hi 
>there"]
> ; --- well this sucks. I cant get a return value upon success
>
> Get your FREE Email and Voicemail at Lycos Communications at
> http://comm.lycos.com

Reply via email to