Search a multidimensional array

MWCM andrew at midwestcoastmedia.com
Fri Apr 20 15:59:50 EDT 2018


I tried to be a good developer and search the list before posting: multidimensional array search turned up some posts from 2014 but most “sort array” searches only returned single dimensional array options. 

I just started using encodedArrays on a recent project and fell in love with the simplicity. They have worked for all my previous efforts, but I’ve never had more than ~300 keys to deal with so a simple repeat loop always worked fast enough. 

I’ve used MySQL database queries in the past with success (thanks to the awesome API that HostM has provided), but this particular data set isn’t stored in an online database and offline access is required due to client circumstances. Before Livecode I’d never dealt with databases at all, so I’m an SQLlite virgin. Looks pretty straight forward though. 

--Andrew Bell
--Sent from my iPhone

> On Apr 20, 2018, at 12:10 PM, use-livecode-request at lists.runrev.com wrote:
> 
> Andrew, you don't peruse this list much, do you? :-)
> 
> A recent thread has been going on about just this issue. The upshot is that one pass through the array is obviously needed for the sqLite conversion, but after that multiple queries can be done much more efficiently. I have code already written that converts an array to a memory sqLite database. Once you do that, you can index on the columns you query most often. Contact me off list and I will send it to you. 
> 
> As an aside, why not just use an sqLite database out of the gate? And to the rest of the list, there should probably be a way to import a file based sqlite database into a memory database and then back again for speed. 
> 
> Bob S





More information about the use-livecode mailing list