[REBOL] Re: Converting Errors to a string?
From: philb:upnaway at: 21-Dec-2001 21:27
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 ....
=== Original Message ===
RE: [REBOL] Re: Coerting Errors to a string?
if error? lv-err: try [Print "AAA" 'ok] [Print "Error"]
if there is no error, try works like do, returning the last value.
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.
if error? set/any 'lv-err try [Print "AAA"] [Print "Error"]
which works ok with unset! too.