Using substacks versus external stacks

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

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 269
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Using substacks versus external stacks

Post by kaveh1000 » Fri Aug 16, 2019 1:18 pm

I have around 10 substacks in a mainstack. I have been wondering what the relative advantages are to having external stacks instead and when building a standalone, just ensure they are bundled with the main stack to be distributed.

Any general advice?
Kaveh

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2354
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Using substacks versus external stacks

Post by jmburnod » Fri Aug 16, 2019 1:40 pm

Hi Kaveh,
I use extrenal stacks because it can be updated without compil
As Klaus said we can't save an external stack from a standalone but we can export/import data from .txt files, i mean content but properties of controls too. :D
Best regards
Jean-Marc

Klaus
Posts: 11062
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Using substacks versus external stacks

Post by Klaus » Fri Aug 16, 2019 2:09 pm

Hi kaveh,

what Jean-Mard said.
kaveh1000 wrote:
Fri Aug 16, 2019 1:18 pm
...just ensure they are bundled with the main stack to be distributed.
In that case add all of your separate stacks via the "Copy files" tab in the "Standalone Application Settings" and access them in your standalone with:

Code: Select all

...
put specialfolderpath("resources") & "/name of separate stack.livecode" into tExternalStack
## Now do whatever you like with tExternalStack :-)
...
Best

Klaus

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 269
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: Using substacks versus external stacks

Post by kaveh1000 » Fri Aug 23, 2019 4:19 pm

Thank you Jean-Marc and Klaus

Sorry to come back late on this, but is my understanding correct that when using the Standalone Application Settings window,
  • If I have external stacks that are needed for the main stack to run, I add these using the stacks panel. The stack is then saved in the standalone and travels with it when I distribute the Standalone
  • If I have external files, e.g. text files that I want to bundle with the Standalone, then I use the Copy files panel, and the behaviour is as above
If the above is correct, then Klaus, why do we need to specify a path with specialfolderpath, etc?
Kaveh

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2354
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Using substacks versus external stacks

Post by jmburnod » Fri Aug 23, 2019 6:13 pm

Hi kaveh,
Yes and Yes :D
You need specialfolderpath() to build filename of your external stack
the behaviour is as above
No.
You can open a stack from the mainstack but you only can import the content of a file ".txt". or launch it by an other software.
Best
Jean-Marc

Post Reply

Return to “Talking LiveCode”