Arrays instead of Sql

Sarah Reichelt sarah.reichelt at gmail.com
Mon May 18 20:51:05 EDT 2009


On Tue, May 19, 2009 at 10:30 AM, Tom Cole <tom.cole at asu.edu> wrote:
> I've heard that instead of using a backend like sql to manage a database, I
> could stay in Revolution and use arrays. I know nothing of arrays.
>
> I've written here before about a bird database I have. Several times.
> Forgive.
>
> I just have a few items in a record:
> birdname,birdnotes,place,placenotes,date  However, there are about 18000
> birds (records) and I've got them all in one field in Rev now and it's too
> slow to sort.

Just as a first test, what if you put the data into a custom property
instead of a field?
Use this CP as the data storage and grab what you need as you need it. e.g.

-------------------------------------------------------------
put the cDataStore of this stack into tData   -- grab the complete
data set out of the custom property into a variable
filter tData with "*" & fld "Filter" & "*"   -- assuming you want to
extract a sub-set
set the itemDel to tab  -- or whatever delimits your columns
sort lines of tData by item 2 of each   -- choose the column to sort by

put tData into fld "Display"  -- show the final results
-------------------------------------------------------------

Even if you end up with the complete set of data after the filter,
sorting a variable is enormously faster than sorting a field.
And getting data out of or into a custom property is again, greatly
faster than for a field.
I have done this successfully with multiple CPs each holding about
40,000 records and operations only take miliseconds.

Cheers,
Sarah



More information about the use-livecode mailing list