rebol script crashes when opened directly but not when done from shell?
[1/2] from: bry::itnisk::com at: 9-Dec-2003 17:55
Hey, I was having work with jabber today over telnet, so I figured I'd
just do a dinky script to handle my jabber posts, I was first working
with it from the shell, but then I closed it cause of administrative
difficulties with my jabber server, then I went and clicked on the
script directly from the filesystem and I got an error saying that
0923582309 referenced memory at 85282092 blah blah, typical windows
error msg, when I went to the shell it worked fine, have tested it
several times now and it always crashes when loaded from the filesystem.
Here's the script
REBOL[
Title: "rebol Jabber"
]
do %telnet/telnet.r
telnet: open telnet://apaches:5222
view layout[
vh2 "jabber:"
below
h1 "Send" return
f1: area {} return
h2 "Receive" return
f2: area "" return
across
button "send"[
insert telnet copy f1/text
port: wait [telnet/sub-port system/ports/input]
either port = telnet/sub-port [
if none? str: copy telnet [break]
append f2/text str ][]
]
button "Close"[telnet: "" quit]
]
[2/2] from: rotenca::telvia::it at: 9-Dec-2003 20:21
Re: rebol script crashes when opened directly but not when done from she
Hi bryan,
> button "send"[
> insert telnet copy f1/text
<<quoted lines omitted: 3>>
> append f2/text str ][]
> ]
You cannot call wait from event code (like the action of a button).
Instead you must insert the port to wait in system/ports/wait-list, adding to
the port an awake function which makes the work.
---
Ciao
Romano
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted