array info request
J. Landman Gay
jacque at hyperactivesw.com
Mon Jul 25 22:15:05 EDT 2005
Thomas McGrath III wrote:
> Pardon me butting in here but I have a question:
> Then what is the best use of arrays? What can/should they be used for?
> I understand the use and need for a custom property and the need for
> databases but what about these here arrays???
Actually, I used arrays exactly as the original poster suggested, and
the application is working great, running the entire public school
library for the Aborigines in the Australian Outback.
They are a small library system. For anything very much larger, I'd go
with a dedicated database as Mark suggetss. But their library tops out
at about 40,000 books right now, and even with room for many thousands
more, I think using arrays is a fine solution.
Each library in the Outback has only a few thousand books. The master
database in Darwin stores the titles for all of them combined, and keeps
track of which school has what. In any case, the current library for
both the schools and the master database is stored as a text file on
disk, just a plain list with one book per line. This text file is read
into memory when the app starts up, split into an array, and uses a
single-card stack as a front end. When a book is accessed, the card
fields are filled in from the array. It is very fast. Memory usage is
minimal; the average school's text file is under 100K for a couple of
Access to any one of 40,000 titles is instantaneous. Searching for
strings is also very fast. Backing up the library is a simple matter of
copying a text file to another volume. Text files compress very well,
which means they can be quickly sent over the internet to another school
(the Outback has very iffy electrical and internet access, so this was
important.) Importing a list of new books is just a matter of reading in
a new text list and adding it to the current array. It all works very
well and very fast.
So I think the original idea is a fine use of arrays. ;)
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the Use-livecode