[REBOL] Re: Converting Errors to a string?
From: philb:upnaway at: 21-Dec-2001 21:27
Thanks Volker,
I passed something back in the end .... but using 'ok would be better.
I had never used unset before .... didnt realise that print returns unset .... I learn
something new from this list almost every day ....
Cheers Phil
=== Original Message ===
RE: [REBOL] Re: Coerting Errors to a string?
use:
if error? lv-err: try [Print "AAA" 'ok] [Print "Error"]
if there is no error, try works like do, returning the last value.
with
if error? lv-err try [1 / 2] [Print "Error"] ; works
you return a number, but with
if error? lv-err try [Print "AAA"] [Print "Error"] ; does not work
you return unset! (the result of a 'print)
so return something, i suggest 'ok here, anything goes.
or use
if error? set/any 'lv-err try [Print "AAA"] [Print "Error"]
which works ok with unset! too.
-Volker
[philb--upnaway--com] wrote: