Stack structure
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Stack structure
I am currently using Live Code to develop an historical project on 16th-century European history. When the project is completed, it will represent several hundred cards (at least 500, probably more) including pictures and sounds. The whole can be divided into chapters like a book. My question is this: is it preferable to develop everything in one stack, or divide the whole project into several stacks, or into substacks (e.g., religion, population, the army, etc.)? I am not quite sure I see the point of substacks vs. stacks. Are there any specific memory issues?
Re: Stack structure
Hi Spiff,
LiveCode will load the COMPLETE stack (including substacks!) into memory,
so splitting your project into smaller pieces (separate stacks) is the way to go.
Best
Klaus
LiveCode will load the COMPLETE stack (including substacks!) into memory,
so splitting your project into smaller pieces (separate stacks) is the way to go.
Best
Klaus
Re: Stack structure
Thank you for your answer. Do you recommend that when I start a new chapter I open a new mainstack or a new substack? Does that make any difference as to memory management?
Re: Stack structure
Hi Spiff,
I think I already answered your question:
In the "Inspector" of these stacks check "destroystack" (Purge stack on close) and "destroywindow" (Purge window on close) if they are not checked!
This will remove these stacks completely from memory when they are closed.
If not, they will stay in memory until you quit!
Best
Klaus
I think I already answered your question:
So, yes, new mainstacks are OK.LiveCode will load the COMPLETE stack (including substacks!) into memory,...
In the "Inspector" of these stacks check "destroystack" (Purge stack on close) and "destroywindow" (Purge window on close) if they are not checked!
This will remove these stacks completely from memory when they are closed.
If not, they will stay in memory until you quit!
Best
Klaus
Re: Stack structure
I don't know, Klaus. I would do it in one stack, since it appears that all cards will be alike. 500 cards is nothing to LC. Why break chapters into separate stacks?
Craig
Craig
Re: Stack structure
Hello Klaus,
I note what you say on purging stacks while closing them.
I did read your comment on LiveCode loading the complete stack including substacks. When you say new mainstacks are "ok", are you saying they are equivalent to substacks? In terms of memory management or otherwise?
Spiff
I note what you say on purging stacks while closing them.
I did read your comment on LiveCode loading the complete stack including substacks. When you say new mainstacks are "ok", are you saying they are equivalent to substacks? In terms of memory management or otherwise?
Spiff
Re: Stack structure
Separate main stacks would require separate executables. That would be very awkward.
Why not go the extra mile and make this app efficient and good as it can be.
Create an Index card with a Tree or Grid, where the Cards would be organized. Ideally you'd have some kind of search feature where the user could search for keywords.
The cards contain three kinds of data: graphics, text, and audio. Put the graphics and text into a SQLite database. This way, the card is empty until loaded, and when it is loaded it is instantaneous, because only the data needed being read into the app. As for the audio files, organize those in folders as an external resource. This way they will play on all platforms. The path the the appropriate audio file would be stored in the database.
Also, instead of creating 500 Cards, create like 12 card templates. Depending on the content of the card, use the most appropriate template.
To design your DB schema, answer these questions.
What's the maximum # of text blocks, graphics, and audio files per card?
Also, add one extra field, Template, which would determine which card to use.
Why not go the extra mile and make this app efficient and good as it can be.
Create an Index card with a Tree or Grid, where the Cards would be organized. Ideally you'd have some kind of search feature where the user could search for keywords.
The cards contain three kinds of data: graphics, text, and audio. Put the graphics and text into a SQLite database. This way, the card is empty until loaded, and when it is loaded it is instantaneous, because only the data needed being read into the app. As for the audio files, organize those in folders as an external resource. This way they will play on all platforms. The path the the appropriate audio file would be stored in the database.
Also, instead of creating 500 Cards, create like 12 card templates. Depending on the content of the card, use the most appropriate template.
To design your DB schema, answer these questions.
What's the maximum # of text blocks, graphics, and audio files per card?
Also, add one extra field, Template, which would determine which card to use.
Re: Stack structure
Hi,
best regards
Jean-marc
No. You can have one standalone which open other stack, That work wellSeparate main stacks would require separate executables
Yes. That is a good way if you accept an a direct acces to the externall resources (everyone can change it)As for the audio files, organize those in folders as an external resource
best regards
Jean-marc
https://alternatic.ch
Re: Stack structure
Thank you, everyone, for your detailed comments.
Spiff
Spiff