Re: persistant state: what is best technique?
Re: persistant state: what is best technique?
- Subject: Re: persistant state: what is best technique?
- From: Emmanuel <email@hidden>
- Date: Tue, 16 Jan 2001 02:22:33 +0100
At 16:38 +0100 15/01/01, Michael Turner wrote:
>
I am scripting Quark scripts, and am considering breaking one of my largish
>
scripts into several quickeys activated scripts. But if I do this, I need to
>
artificially preserve the state of one or two variables from script to
>
script. I can think of a couple ways to do this, but I don't like any of
>
them. Does anyone have a suggestion?
I suggest that you maintain a script file, and that you store the
persistent variables as properties.
Example.
The script file will contain:
-------------------
property my
Data:{}
-------------------
You retrieve the data with:
------------------- non tested
set theScript to (load script alias thePathName)
set theData to (get myData of theScript)
-------------------
You store the data with:
------------------- non tested
set theScript to (load script alias thePathName)
set myData of theScript to theData
store script in (alias thePathName) replacing yes
-------------------
HTH
Emmanuel