Replacing Stacks in Memory

Mark Waddingham mark at livecode.com
Tue Feb 16 13:54:27 EST 2016


On 2016-02-16 19:11, Michael Doub wrote:
> I am building a launcher app the loads stacks from DropBox.
> I am using
> 
> go URL tURL where the tURL is the stack to load using the correct
> DropBox format.
> 
> This works great for the first load.  However, if I update the stack
> in DropBox and try to reload tURL, it does not purge the existing
> stack and load the new one.

Okay so when you do 'go url tURL' what is actually happening is you are 
doing:

   go (<expr>)

If <expr> evaluates to binary data which looks like a stackfile (after 
the engine's tried viewing it as a name of stack, and failed) it will 
try and load that binary data into memory as a stackfile. If there is 
already a stackfile in memory with that name, then the normal engine 
processes will kick-in and (most likely, as the stack doesn't have a 
filename) cause the existing stack which is in memory to be preserved, 
and the new one ditched.

Now, a stack loaded with the above form will not have a filename, so 
'revert' won't work. Instead, you'll probably need to do:

   delete stack <nameofstackwhichwasgourld>
   go url ...

Hope this helps!

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list