It's easy to save a stack as a separate file, and it's how I usually do it for preferences. But you can use the technique for anything else too. If you don't want it to open with the LC IDE then give it a custom extension; LC doesn't care what the filename is as long as it's a valid stack. I often use ".dat" just because it's fairly ambiguous.
Save the stack in the user's Documents folder or application support folder. Your app can open the stack, invisibly if you want, extract any data you need, and display it. Besides easy access to text and images, you can also store arrays in custom properties or any other type of data.
Code: Select all
create stack "dataStore"
copy image 1 of this cd of stack "myApp" to cd 1 of stack "dataStore"
set the filename of stack "dataStore" to (specialFolderPath("documents") & "/myAppData.dat")
save stack "dataStore"
Or if you'd rather save the image as binary data, use:
Code: Select all
set the cImage of stack "dataStore" to the imagedata of img 1 of this cd of stack "myApp"
If you would rather save a folder, then you can do that too. Create the folder and export the images to it, then use the revZip external if you want a single file. I don't usually mess with zipping and unzipping because it's so much easier to just stuff things into a stack, but you could.