[SOLVED] Start using stack vs insert script into back?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
Zax
Posts: 519
Joined: Mon May 28, 2007 10:12 am
Contact:

[SOLVED] Start using stack vs insert script into back?

Post by Zax »

Hello,

After reading the Dictionary, I can't see significant differences between:

Code: Select all

start using stack
and

Code: Select all

insert the script of stack "myStack" into back
Message libraryStack doesn't seem to be sent with the insert the script command. Is there other differences, and what is the best solution to use a stack's script as library?

Thank you.
Last edited by Zax on Tue Mar 31, 2020 7:12 am, edited 1 time in total.
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Start using stack vs insert script into back?

Post by Klaus »

Hi Zax,

yes "librarystack" is only sent to a stack you "start using".
But in the end:

Code: Select all

start using stack xyz
and

Code: Select all

insert the script of stack "myStack" into back
do the same thing.


Best

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

Re: Start using stack vs insert script into back?

Post by jacque »

There are slight differences, but the two are mostly similar. Back in MetaCard days, scripts inserted into back got messages after the home stack while stacks in use (libraries) got messages just before it. That may have changed by now. The other difference, still true today, is that insertion is silent, but in-use stacks receive a "librarystack" message when they are put in use. You can do any initialization there if needed, and is how a library stack can respond when used as a CGI on a server.

Other than that they behave very much alike.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
Zax
Posts: 519
Joined: Mon May 28, 2007 10:12 am
Contact:

Re: Start using stack vs insert script into back?

Post by Zax »

Thank you for your answers.
"librarystack" message can be very convenient indeed.
Post Reply