[REBOL] Re: Coerting Errors to a string?

2001-12-20 Thread nitsch-lists
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 numb

[REBOL] Re: Coerting Errors to a string?

2001-12-20 Thread philb
Thanks Volker, I will use this in my error handling The next question is am I handling my errors correctly? For Example if error? lv-err: try [1 / 0] [Print "Error"] ; works if error? lv-err try [1 / 2] [Print "Error"] ; works However if error? lv-err try [Print "AAA"] [Print "Error"] ; does n

[REBOL] Re: Coerting Errors to a string?

2001-12-20 Thread nitsch-lists
RE: [REBOL] Coerting Errors to a string? (original by Bo somewhere, called print-error. forgot if i changed something.) form-error: func [ error [object!] /local arg1 arg2 arg3 message out ] [ out: make string! 100 set [arg1 arg2 arg3] [error/arg1 error/a

[REBOL] Re: Coerting Errors to a string?

2001-12-20 Thread Larry Palmiter
Hi Phil, How about MOLD? It will convert to a string formatted the same as PROBE. >> print mold :err make object! [ code: 400 type: 'math id: 'zero-divide arg1: none arg2: none arg3: none near: [a: 1 / 0] where: none ] -Larry - Original Message - From: