[REBOL] write does not return a value upon success. This is bad for try blocks R
From: lmecir:geocities at: 7-Sep-2000 19:19
Hi,
try this:
tries: 3
until [
set/any 'm try [write
ftp://chuck:[chuck1--170--16--15--136]/crossing/ndtd/user.r "hi there"]
tries: tries - 1
any [tries = 0 unset? get/any 'm]
]
Regards
Ladislav
> 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:[chuck1--170--16--15--136]/crossing/ndtd/user.r
hi there
]
> connecting to: 170.16.15.136
> ** User Error: Server error: tcp 530 Login incorrect..
> ** Where: write ftp://chuck:[chuck1--170--16--15--136]/crossing/ndtd/user.r "hi
there"
> ; -- great: when write fails 'm is bound
> >> m: try [ write ftp://chuck:[chuck--1--170--16--15--136]/crossing/ndtd/user.r
hi there
]