storing a stack as a customprop

Peter Brigham MD pmbrig at gmail.com
Sun Oct 18 11:43:40 EDT 2009


Thank you Jim, Mark, and Richard. That was it. As soon as you all  
pointed out the parentheses issue I did a head slap -- of course, the  
part of my brain that had tucked away that little point of grammar had  
been temporarily disconnected. It's happening a little more often  
these days....

I hate this damn computer.
I wish that I could sell it --
It doesn't do what I want it to...
Only what I tell it.

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig


On Oct 17, 2009, at 9:12 PM, Jim Ault wrote:

>> 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
>
>
>
> _______________________________________________
> 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




More information about the use-livecode mailing list