storing a stack as a customprop

Jim Ault jimaultwins at yahoo.com
Sat Oct 17 21:12:29 EDT 2009


>  put url "file:" & filePath into stackData
should be

put url ("file:" & filePath) into stackData

Jim Ault
Las Vegas

On Oct 17, 2009, at 4:59 PM, Peter Brigham MD wrote:

> I'm stuck. I swear I got this to work for a few minutes and now it  
> isn't working. I changed something and broke it.
>
> I'm trying to store a stack ("stackToSave") as a customproperty of a  
> stack called "updateList". As far as I can tell the way to store a  
> currently open stack in a property is to first save it to disk and  
> use something like
>
> set the storedStack of stack "updateList" to URL "file:" & filepath
>
> First question: is this the way to approach this task?
>
> If so, then a few more details: the stack "stackToSave" is a  
> substack of a stack "myMainStack" currently open in the IDE (all of  
> this is taking place in the IDE). The stack "updateList" is not part  
> of the same stackfile. I'm thinking I have to clone the stack  
> "stackToSave" first so I can save it independently. Second question:  
> is this true?
>
> I have a script in the stack "updateList" that calls a handler  
> "storeStack":
>
> ...
> put "stackToSave" into stName
> storeStack stName
> ...
>
> on storeStack s
>   clone invisible stack s
>   -- when I do a clone stack s (without the invisible)
>   -- I can see the cloned stack open fine and it's
>   -- listed in the Application Browser as
>   -- "Copy of stackToSave"
>   put the filename of stack "myMainStack" into filePath
>   set the itemdelimiter to "/"
>   put s & ".rev" into item -1 of filePath
>   put "Copy of" && s into sName
>   save stack sName as filePath
>   -- breakpoint
>   -- when I break here and look in the Finder I see
>   -- that the stack is indeed saved successfully
>   put url "file:" & filePath into stackData
>   set the storedstack[s] of stack "updateList" to stackData
>   save stack "updateList"
>   delete file filePath
>   close stack sName
> end storeStack
>
> However, the result of this is that the contents of the property  
> <the storedStack["stackToSave"] of stack "updateList"> is simply the  
> filepath of the saved cloned stack. Clearly I'm not actually getting  
> the stack itself into the property.
>
> I'm using a custompropertyset because I will eventually be storing  
> several stacks at a time in the updateList stack.
>
> Is there some wrinkle here I don't get? I'm using a MacBook, OSX  
> 10.5.8, Rev Studio 3.5.0-gm-2, build 870.
>
> -- Peter
>
> Peter M. Brigham
> pmbrig at gmail.com
> http://home.comcast.net/~pmbrig
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

Jim Ault
jimaultwins at yahoo.com






More information about the use-livecode mailing list