storing a stack as a customprop

Richard Gaskin ambassador at fourthworld.com
Sat Oct 17 21:17:59 EDT 2009


Peter wrote:

 > set the storedStack of stack "updateList" to URL "binfile:" & filepath

Looks like Mark caught it.  Without the parentheses, the engine 
interprets the above as:

1. get url "binfile:"
2. append that data with filepath
3. store it in the specified property

But with parens it first concatenates the "binfile:" and filepath into a 
single string that's then used as the source for the URL.

All I can add to Mark's excellent sleuthing is some extra credit:

You can save about 30% or more on average by compressing the data before 
storing it:

  set the storedStack of stack "updatelist" to \
    compress( url ("binfile:" & filePath) )

To spit it back out just reverse the order of the operations:

  put decompress( the storedStack of stack "updatelist" \
     unto url ("binile:" & someNewPath)


--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv



More information about the use-livecode mailing list