Page 1 of 1
When has the internet library loaded?
Posted: Wed Dec 12, 2012 3:44 am
by Simon
Hi,
Is there a message that I can monitor that indicates that the Internet Library has loaded? Or all libraries have loaded?
The docs just say don't used a command at startup, preOpenStack... Not very precise.
THX,
Simon
Re: When has the internet library loaded?
Posted: Wed Dec 12, 2012 4:46 am
by FourthWorld
What conflict are you having with it?
There are ways to invoke it whenever you need it.
Re: When has the internet library loaded?
Posted: Wed Dec 12, 2012 7:28 am
by shaosean
Simon, the internet library is included in a hidden group on your mainStack and is not available until after it loads (following the load order through the message path).. You can always include a backScript to listen for the
libraryStack message and the you can check against the list of
stacksInUse to see if the internet library is loaded
Re: When has the internet library loaded?
Posted: Wed Dec 12, 2012 6:48 pm
by Simon
Thanks Richard & Shaosean for your reply's.
After upgrading to LC 5.x my applications started throwing an error on libUrlSetSSLVerification false that I put down to the internet library not being loaded. Since my apps mainly communicate with servers I want to start using the library as soon as possible, just to test if the user is online.
I will investigate Shaosean's suggestions and see what happens.
Simon
Re: When has the internet library loaded?
Posted: Wed Dec 12, 2012 6:56 pm
by jacque
Libraries are included in a standalone as an hidden group, and so they will load after the first card's background loads. Basically you can count on them being available after the first card is open (it's actually a bit sooner than that, but waiting for the card to open will always work.)
I don't think the librarystack message is sent for groups, is it?
Re: When has the internet library loaded?
Posted: Wed Dec 12, 2012 8:11 pm
by Simon
hmmm...
I just made a new stack with:
Code: Select all
on openCard
libUrlSetSSLVerification false
end openCard
and it threw an error again.
but:
Code: Select all
on openCard
load url "http://www.runrev.com/"
end openCard
Does work.
It must be the libUrl, is there something different about it?
Simon
EDIT: error message
executing at 11:12:23 AM
Type Handler: can't find handler
Object card id 1002
Line libUrlSetSSLVerification false
Hint libUrlSetSSLVerification
Re: When has the internet library loaded?
Posted: Wed Dec 12, 2012 9:17 pm
by Simon
OK another data point.
This is acting like the breakpoint troubles. Opening the stack from the IDE File>Open does not throw the error, double clicking on the .livecode file does. Both occur since the release of LC 5.x. Not a big problem if that's all it really is.
Simon
Re: When has the internet library loaded?
Posted: Thu Dec 13, 2012 10:44 pm
by jacque
Sounds like the IDE hasn't loaded libURL yet. If you open the stack from the File menu then everything has already loaded. Your own apps will likely act the same way.
For your apps you could do a "send" on openCard that calls a handler which in turn sets the libURL functions. Send the message in 1 second or so, to give everything else time to load.