[REBOL] Problem with try [ open/direct/binary tcp://... ] Re:(3)
From: g:santilli:tiscalinet:it at: 3-Oct-2000 9:46
[eventi--nyic--com] wrote:
> gp: try [ open/... ]
> and
> try [ gp: open/... ]
>
> should be equivalent, no?
They are. Look:
>> try [wrong-code]
** Script Error: wrong-code has no value.
** Where: wrong-code
>> err: try [wrong-code]
** Script Error: wrong-code has no value.
** Where: wrong-code
The word 'ERR is successfully set to the error, too:
>> type? err
== error!
>> err
** Script Error: wrong-code has no value.
** Where: wrong-code
But as you see, as soon as an error value is caught by the
interpreter, it fires; if you don't want it to explode you have to
disarm it with the DISARM function, or consume it with some
function that is able to take an ERROR! as an argument (like
ERROR?, or TYPE? above).
>> error? err
== true
>> probe disarm err
make object! [
code: 300
type: 'script
id: 'no-value
arg1: 'wrong-code
arg2: none
arg3: none
near: [wrong-code]
where: none
]
> Thanks for the sexy join code!!
You could avoid JOIN at all. Use OPEN like this:
Open/direct/binary [scheme: 'tcp host: ip port-id: port]
(Also note that TCP ports are always /DIRECT, so you don't need to
use that refinement.)
HTH,
Gabriele.
--
Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/