Load URL doesn't send message
Sarah Reichelt
sarahr at genesearch.com.au
Fri Jul 29 01:31:47 EDT 2005
>>> I'm using libURL 1.1.3b1 (apparently what ships with 2.6) and
>>> can't get a message when the URL is done. I'm trying:
>>>
>>> load url tURL with message "myMsg"
>>>
>>> No message is sent. Is it just me?
>>>
>>>
>> It's working for me, with the same version. Do you get anything
>> if you check "the result" right after the "load" command?
>
> What handlers are you using? Do you do a urlStatus check with a
> progress bar? That seems to be part of the problem, near as I can
> tell. Of course, I could be doing something dumb.
No, in the tests I was doing I just did the load with no progress
checking, but I've just tried 2 different methods and they both worked.
Method 1:
on mouseUp
put "http://www.whatismyip.com/" into sURL
libURLSetStatusCallback "showProgress", the long ID of me
load URL sURL with message gotPage
end doCheck
on showProgress pURL, pStatus
put the ticks && pStatus
end showProgress
on gotPage pURL, pStatus
beep
libURLSetStatusCallback
-- do other processing
end gotPage
Method 2:
on mouseUp
put "http://www.whatismyip.com/" into sURL
load URL sURL with message gotPage
showProgress
end doCheck
on showProgress
put the URLStatus of sURL into tStatus
put the ticks && tStatus
if tStatus <> empty then send showProgress to me in 2 ticks
end showProgress
on gotPage pURL, pStatus
beep
-- do other processing
end gotPage
Both of these beeped as expected when the "gotPage" message arrived.
I see that you put your callback name in quotes & I don't. Yours
looks more correct, but it couldn't be doing weird things, could it?
Cheers,
Sarah
More information about the use-livecode
mailing list