Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Error fuzzy logic

From: fsievert:uos at: 26-Aug-2001 15:34

> ------------------------------------------------------------- > > if connected? [ > if error? error: try [send [ptretter--charter--net] read %log.txt][error: disarm error] > ] > > -------------------------------------------------------------
The problem ist not the "error?", but the "error:" Send will, when it does not fail, return "null" and this causes the "needs a value" problem when trying to set the word "error:". The sollution: if error? set/any 'error: try [....] set/any allowes to set null to values, too. An other sollution would be: if error? error: try [.... none] Your example looks not like it will send the email. Because you are producing a function and check it, if it is an error. This is not true, because function! <> error! . So you will not run the if-body