How to force a reload of a datastack.
Ian McKnight
iangmcknight at gmail.com
Sun Jan 2 16:04:00 EST 2011
Hi
I had forgotten about revert - I just thought it was an entry on the File
menu! As my program/app loads a separate data stack which is the one I want
to revert then would need to do this?
put the defaultstack into myOldStack
set the defaultstack to myDataStack
revert
set the defaultstack to myOldStack
Thanks
On 2 January 2011 19:02, J. Landman Gay <jacque at hyperactivesw.com> wrote:
> On 1/2/11 12:38 PM, Ian McKnight wrote:
>
>> Hi
>>
>>
>> Could someone confirm (or otherwise) that what I hope to happen with this
>> script will indeed happen?
>>
>> I have a stack loaded into memory at start up. I have exclusive use of it
>> for a period of time. When the time runs out someone else can use and
>> change
>> the stack. But I want to use the data stack again - after it has been
>> changed by someone else but as I haven't quit my program I still have the
>> 'old' version in memory. Will this script force the file to be re-read
>> from
>> disc?
>>
>> command openDataFile pName
>> --------------------------------------------
>>
>> if gWaitingToGoAgainAfterTimeOut = false
>> then
>>
>> -- load the file first time of asking
>>
>> put "data/"&pName into tName
>> open invisible stack tName
>>
>> else
>>
>> -- stack could have changed
>> -- clear my old version out of memory
>> -- and load stack again
>>
>> set the destroyStack of stack pName to true
>> close stack pName
>> open invisible stack tName
>>
>> end if
>> end openDataFile
>>
>
> It should. But I usually just use the "revert" command, which forces a
> reload without closing the stack.
>
> --
> Jacqueline Landman Gay | jacque at hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
--
Regards
Ian McKnight
iangmcknight at gmail.com
=======================
More information about the use-livecode
mailing list