Arrays

Phil Davis davis.phil at comcast.net
Thu Feb 3 20:41:08 EST 2005


I love questions like this one.


on saveArray

   global gBigArray

   -- target a specific custom property set
   set the customPropertySet of stack "allMyArrays" to "uBigArray"

   -- replace all elements of 'uBigArray' CPS with 'gBigArray'
   set the customProperties of stack "allMyArrays" to gBigArray

   -- save it
   save stack "allMyArrays"

end saveArray



Then three days later, to get those values back into an array variable:



on loadArray

   global gOtherBigArray

   -- target a specific custom property set
   set the customPropertySet of stack "allMyArrays" to "uBigArray"

   -- replace all elements of 'gOtherBigArray' with the 'uBigArray' CPS
   put the customProperties of stack "allMyArrays" into gOtherBigArray

end loadArray



HTH -
Phil Davis



Ben Fisher wrote:
> I'm using fairly large arrays. These need to be stored as a file on the hard drive or in some other manner. The trick is that they have to be quickly retrieved. 
> 
> The way I'm handling this now is to write all the elements of the array into return-delimited data, compressing this data, and then writing it to the file. This is slow to retrieve. I know that it's slow to find the nth line of something, but I can't think of another way to delimit the data.
> 
> Can anyone think of a way to store an array? Can it be saved into the stack somehow?
> 
> -Ben
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 


More information about the use-livecode mailing list