Confused about storing arrays in a custom property

Bob Sneidar bobs at twft.com
Mon Aug 22 13:51:53 EDT 2011


interesting. Trevor shared some time ago his printKeys() function so that given:
    put "xyz" into aData["abc"]["def"]
    put "qrs" into adata["abc"]["ghi"]
    put printkeys(aData)

you would get:
abc
     ghi: qrs
     def: xyz

A similar method could probably be devised to put the data back into an array. 

All this seems like a lot of trouble though. Why not just store the array in a custom property? 
set the aArray of this card to aData -- or this stack if it is a single array

Bob


On Aug 22, 2011, at 10:29 AM, Pete wrote:

> Thanks Andrew and Bob.  Unfortunately, I'm using an sqlite database and as
> far as I can tell from the docs, it doesn't have a binary data type.  I
> could define a column as BINARY but it would end up as NUMERIC in sqlite's
> world.  I'll give it a whirl though.
> 
> I've actually now written a function to convert a multidimensional array
> into a string with one line for each of the first level keys and each line
> containing the keys separated by tabs, ending up with the value in the
> lowest level key.  That way I can just store the text string in the db
> without a problem, and I also have a simple command to assemble the strings
> into an array when I read them back from the db. So if Array["abc"]["def"]
> contains "xyz", the resulting line would be "abc<tab>def<tab>xyz".  This was
> the cause of my other recent posts about what happens when the last item in
> a string is empty.  Provided some interesting recursion opportunities!
> 
> Pete
> Molly's Revenge <http://www.mollysrevenge.com>
> 
> 
> 
> 
> On Mon, Aug 22, 2011 at 9:49 AM, Andrew Kluthe <andrew at rjdfarm.com> wrote:
> 
>> It sounds to me like binary is the data type you want here.
>> 
>> --
>> View this message in context:
>> http://runtime-revolution.278305.n4.nabble.com/Confused-about-storing-arrays-in-a-custom-property-tp3757539p3760664.html
>> Sent from the Revolution - User mailing list archive at Nabble.com.
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list