[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: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Zax
Posts: 468
Joined: Mon May 28, 2007 10:12 am
Location: France
Contact:

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

Post by Zax » Mon Mar 30, 2020 2:17 pm

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: 13828
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Start using stack vs insert script into back?

Post by Klaus » Mon Mar 30, 2020 2:47 pm

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: 7233
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Start using stack vs insert script into back?

Post by jacque » Mon Mar 30, 2020 6:33 pm

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: 468
Joined: Mon May 28, 2007 10:12 am
Location: France
Contact:

Re: Start using stack vs insert script into back?

Post by Zax » Tue Mar 31, 2020 7:12 am

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

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”