Serialising arrays
viktoras d.
viktoras at ekoinf.net
Tue Apr 14 02:30:16 EDT 2009
Hi Steve,
arrayEncode outputs an array in binary form (for binary storage or
transfer), not text. When you need to transform array into list do:
combine myArray using return and tab. After this array myArray becomes a
list of key-value pairs:
key value
key value
key value
...
key value
Now if you do
split myArray by return and tab
myArray becomes an array again.
regards
Viktoras
Steve Checkley wrote:
> Hi all,
>
> I'm storing data in an application using arrays and I need to save
> these out to a file.
>
> I've serialised the data using the arrayEncode function but can't
> decode it back again.
>
> The structure of the save file is to place a marker such as
> <productList>, add a return character, then the serialised array,
> another return character and then a closing marker, </productList> in
> this case.
>
> When viewed in a text editor, it looks like:
>
> <productsList>
> random characters
> more randomeness
> </productsList>
>
> Using lineOffSet, I'm finding the first and last lines of the
> serialised array. It's when I come to decode the array that it falls
> over.
>
> Any pointers? Is this the best way to save arrays to text?
>
> Thanks in advance,
>
>
> Steve
>
> _______________________________________________
> 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