Making a Standalone's Material Savable.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Making a Standalone's Material Savable.
I'm not a beginner at all but this is so basic that I thought I'd ask here. I've completely forgotten how to make my changes in a standalone SAVABLE.
I'm making a little flash card program for language students. They will put in their words and save them.
The standalone settings have to allow this.
What did I use to do?
Thank you very kindly, for refreshing my memory.
Tom in Arizona
I'm making a little flash card program for language students. They will put in their words and save them.
The standalone settings have to allow this.
What did I use to do?
Thank you very kindly, for refreshing my memory.
Tom in Arizona
Re: Making a Standalone's Material Savable.
I'm posting a reply to my own question. I just looked; it's not in the standalone settings.
I put this is the stack script:
on closestack
answer "Save Changes?" with "Yes" or "No"
if it is "yes" then save stack "datastack"
end closestack
Never mind!
Thanks anyway,
Tom
I put this is the stack script:
on closestack
answer "Save Changes?" with "Yes" or "No"
if it is "yes" then save stack "datastack"
end closestack
Never mind!
Thanks anyway,
Tom
Re: Making a Standalone's Material Savable.
Hi Tom,
You can't save changes in a standalone. You need to save your data in a file outside your standalone. This file can also be a stack. Good places to save such files are the preferences folder or application data folder, the documents folder, and sometimes the home folder or application support folder. These folders are not always available on every operating system.
Kind regards,
Mark
You can't save changes in a standalone. You need to save your data in a file outside your standalone. This file can also be a stack. Good places to save such files are the preferences folder or application data folder, the documents folder, and sometimes the home folder or application support folder. These folders are not always available on every operating system.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Making a Standalone's Material Savable.
You're right. I've discovered that it doesn't work after all. I thought it did.
I'm not sure what to do. I have a stack where you do your work and a data stack that has the data. How can I make that data stack a file that can be saved? The idea is for people to write in material to be studied later and added to.
Thanks for helping me.
Tom
I'm not sure what to do. I have a stack where you do your work and a data stack that has the data. How can I make that data stack a file that can be saved? The idea is for people to write in material to be studied later and added to.
Thanks for helping me.
Tom
Re: Making a Standalone's Material Savable.
A couple ways. You can set the mainstack of your data stack to point to itself and save it as a separate stack file, then load it from your standalone stack. (you can add files to the build in the standalone settings, forget the exact name of the tab but it's pretty obvious. Select the stack you want to add to the build and it will be included and placed in the .app package on mac, or next to the exe on win/linux, or in the apk for android. I assume for ios is the same (inside the package) but haven't built for ios so not sure.
If you're building for a mobile device you'll need to copy the stack file from the engine folder into the documents folder so that it is writable.
You can also change a setting in the standalone settings that will "save substacks as separate stack files.." but I forget where that checkbox is.
If you're building for a mobile device you'll need to copy the stack file from the engine folder into the documents folder so that it is writable.
You can also change a setting in the standalone settings that will "save substacks as separate stack files.." but I forget where that checkbox is.
-
- VIP Livecode Opensource Backer
- Posts: 9670
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Making a Standalone's Material Savable.
This is an issue because no OS will allow an executable to save to itself.
I use the "splash screen" approach, whereby a mostly functionless mainstack is used as the executable, and any number of other stacks are added to it as ancillary files. The splash screen is sort of the front end, and the working stack(s) can then be used in the ordinary way, and you can save as needed. These ancillary stacks are added in the standalone settings. You can also add other files, (e.g ".bundle") as required.
Craig Newman
I use the "splash screen" approach, whereby a mostly functionless mainstack is used as the executable, and any number of other stacks are added to it as ancillary files. The splash screen is sort of the front end, and the working stack(s) can then be used in the ordinary way, and you can save as needed. These ancillary stacks are added in the standalone settings. You can also add other files, (e.g ".bundle") as required.
Craig Newman
Re: Making a Standalone's Material Savable.
Yes, now I see how I used to do this. I used a splash screen and a datastack. Thanks. It's working now!
Re: Making a Standalone's Material Savable.
Hi friends,
please keep in mind that this will only work, if the current user has admin rights!
Other users do NOT have permissions to write (= save a stack) in the current OS
"Application" or "Programms" folder!
Best
Klaus
please keep in mind that this will only work, if the current user has admin rights!
Other users do NOT have permissions to write (= save a stack) in the current OS
"Application" or "Programms" folder!
Best
Klaus
Re: Making a Standalone's Material Savable.
yeah, better to treat desktop as if they were mobile also and make a copy in appdata or documents folder and use it from there.
Klaus wrote:Hi friends,
please keep in mind that this will only work, if the current user has admin rights!
Other users do NOT have permissions to write (= save a stack) in the current OS
"Application" or "Programms" folder!
Best
Klaus
Re: Making a Standalone's Material Savable.
I don't understand. It seems to work for me on both mac and windows platform standalones. How will I come to grief?
Tom
Tom
Re: Making a Standalone's Material Savable.
If the standalone package (or on windows/linux, the standalone and any other files and folders) are placed into the applications folder, program files folder, or one of the binary paths on linux, a regular user may not be able to write to those directories without elevating privilege. Of course on desktop, if the files are in user space then its not really an issue.
Re: Making a Standalone's Material Savable.
Well, this is for friends, so I can tell them that. Thanks