[EMAIL PROTECTED] wrote:

> Connect: Func [ ip port ] [
>         Gp: try [
>                 Open/direct/binary probe To-url join "tcp://" [ Ip ":" port ]
>         ]
>         if not error? gp [
>                 insert gp "GNUTELLA CONNECT/0.4^/^/"
>                 print to-string data: copy gp
>         ]
>         return gp
> ]

You need to write it this way:

Connect: Func [ ip port ] [
        either not error? Gp: try [
                Open/direct/binary probe To-url join "tcp://" [ Ip
":" port ]
        ] [
                insert gp "GNUTELLA CONNECT/0.4^/^/"
                print to-string data: copy gp
                gp
        ] [
                disarm gp
        ]
]

(You'll get an object as result if there was an error; I think
this is what you intended with the code above. Notice that you
cannot return an error without disarming it into an object.)

HTH,
   Gabriele.
-- 
Gabriele Santilli <[EMAIL PROTECTED]> - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/

Reply via email to