Where to place (sub)stacks?
David Glasgow
david at dvglasgow.wanadoo.co.uk
Thu Sep 17 05:33:22 EDT 2009
On 16 Sep 2009, at 6:00 pm, Klaus wrote:
> If I would ever need to let the users modify and save STACK files,
> I would go this way:
>
> 1. Create all the stacks that will be modified and saved by the end
> user as MAIN stacks!
> 2. Import each of these stacks into a custom porperty of your
> SPLASH/main stack
> ...
> set the cStack01 of stack "splash or whatever" to url("binfile:" &
> path_to_your_stack)
> ...
> 3. When the app starts, I would check if these stacks have already
> been "outputted" into the users "preferences folder:
> Mas OS X: specialfolderpath("preferences")
> ## Current user only
>
> Windows: specialfolderpath(26)
> ## Current user only
>
> Might be good style to create a subfolder for your app there!
>
> If the stacks are not yet there, I would output all the stacks from
> your CPs:
> ...
> put specialfolderpath("preferences") into tFolder
> put the cStack01 of stack "splash or whatever" into url("binfile:"
> & tFolder & "/" & "name of original stack here...")
> ## NO suffix necessary!
> ...
> 4. Now the user (your app) can open any of these stack, modify them
> and save them again without permission problems.
>
> 5. Pro: If a user deletes one of your stacks (c'mon, we all know
> how they are :-D) you can quickly replace it with a fresh copy!
>
> Know what I mean?
> Drop a line if not :-)
>
>> ,,,
>> Beat Cornaz
>
> Best
>
> Klaus
>
> --
> Klaus Major
> http://www.major-k.de
> klaus at major.on-rev.com
Klaus,
This issue has caused me considerable pain in the past, but I have
sorted most of it out since Vista flounced onto the OS stage with
such ill placed confidence. I have just had a results stack in
the installation folder, and copied it to the users documents folder
if it isn't already there. (This is a little unsatisfactory in that
the results file isn't exactly a user's document in the simplest
sense, but it does work.)
However, I have never come across the stack as a custom property in
this context. What is the advantage of doing it that way? Is it that
you set the property in the IDE, and so don't actually need the stack
to be anywhere else in the installation once you build?
Intrigued..
David Glasgow
More information about the use-livecode
mailing list