http://www.rebol.net/cookbook/recipes/0038.html not working for newbie
[1/3] from: kpeters::mvinc::net at: 11-Jan-2004 19:21
Hi all ~
The above does not work for me:
When using it exactly as shown (log-data %log.txt "Opened"), I receive
** Script Error: attempt has no value
** Where: log-data
** Near: attempt [write/append file data]
Any ideas?
Thanks,
Kai
[2/3] from: greggirwin:mindspring at: 11-Jan-2004 20:49
Hi Kai,
KP> ** Script Error: attempt has no value
KP> ** Where: log-data
KP> ** Near: attempt [write/append file data]
ATTEMPT was added in one of the more recent versions. You can patch it
in though.
attempt: func [
{Tries to evaluate and returns result or NONE on error.}
value
][
if not error? set/any 'value try :value [get/any 'value]
]
-- Gregg
[3/3] from: andreas:bolka:gmx at: 12-Jan-2004 4:56
Monday, January 12, 2004, 4:21:44 AM, Kai wrote:
> When using it exactly as shown (log-data %log.txt "Opened"), I
> receive
> ** Script Error: attempt has no value
> ** Where: log-data
> ** Near: attempt [write/append file data]
> Any ideas?
Looks like you are using an older version of REBOL that misses the
'attempt function. I'd suggest upgrading to a recent version, but you
could also simply add attempt yourself:
attempt: func [
{Tries to evaluate and returns result or NONE on error.}
value
][
if not error? set/any 'value try :value [get/any 'value]
]
--
Best regards,
Andreas