When has the internet library loaded?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

When has the internet library loaded?

Post by Simon » Wed Dec 12, 2012 3:44 am

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10058
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: When has the internet library loaded?

Post by FourthWorld » Wed Dec 12, 2012 4:46 am

What conflict are you having with it?

There are ways to invoke it whenever you need it.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: When has the internet library loaded?

Post by shaosean » Wed Dec 12, 2012 7:28 am

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: When has the internet library loaded?

Post by Simon » Wed Dec 12, 2012 6:48 pm

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7394
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: When has the internet library loaded?

Post by jacque » Wed Dec 12, 2012 6:56 pm

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?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: When has the internet library loaded?

Post by Simon » Wed Dec 12, 2012 8:11 pm

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: When has the internet library loaded?

Post by Simon » Wed Dec 12, 2012 9:17 pm

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7394
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: When has the internet library loaded?

Post by jacque » Thu Dec 13, 2012 10:44 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply