We use these arrays with media metadata that is extracted from our database of 
media metadata. The dbase was originally designed for lots of columns so that 
"there is nothing we cannot know about a media item" incorporating DCIM columns 
and also W3C media metadata initiative's recommended properties.  In actually 
usage for any give media item only a small subset of columns containe any data. 
but we do use almost all the columns at one time or another.  There are no 
blobs, so this is very light weight data.

Anyway… this results in arrays which contain 1 top level key per record and 
that element contains another 40 or so keys for the columns of the database. 
most of which are empty/unused. So these arrays are never "heavy" in terms of 


aPlayList  may have 1000 keys (numeric 1-1000)

where each top level key contains a whole record:

in each one we have

aPlayList [1]["title"]
aPlayList [1]["subtitle"]
aPlayList [1]["genre"]
aPlayList [1]["description"]
aPlayList [1]["artist"]
aPlayList [1]["theme"]
aPlayList [1]["creator"]
aPlayList [1]["audience"]

# and 30+  more "properties" for the media item

OK so let's say user  want sto search "blues"  and I want the UX to check *all* 
columns in the array.  What is the best way to do this?

I tried a simple test.

on mouseup
put "apple" into aFruits["1"]
put "orange" into aFruits["2"]
put "plum" into aFruits ["3"]
put aFruits contains "orange"
end mouseup

and it returns "false"

The only other strategy I can see would be

put 1 into z # for our new filtered play list

repeat for each key x in aPlaylist
       repeat for each key y in aPlayList[x]
          if aPlayList[x][y]contains "blues" then
             put aPlayList[x] into aFilteredPlayList[z]
             add 1 to z
         end if
        end repeat
end repeat

So then if we started with 1000 "records" in the array and we found "blues" in 
any column of any record, for, say 20 of them, we end up with a new array.

  aFilteredPlayList  # containing top level keys 1-20 for 20 records, put the 
titles into a list field and viola: the clickline number matches the array key 
and away we go.

OK I can make this work, (have to since I don't see another way)

But it seems like a lot of looping.

Is there a more efficient approach?


use-livecode mailing list
Please visit this url to subscribe, unsubscribe and manage your subscription 

Reply via email to