On Wed, 16 Feb 2000, Peter Reid wrote:

> Is there any good material on the use of associative arrays in 
> MetaCard?  I'm trying to implement a smallish database by uploading 
> text files into associative arrays and then exporting them 
> afterwards.  There seems to be very little advice/examples in the 
> MetaCard help etc. on this subject.

There's an example similar to what you need to do in the Examples
stack (card 6).

> I'm using delimited text files to act as the permanent store of the 
> database files.  Each file consists of a series of lines (records), 
> each of which consists of a series of delimited items (fields).  Is 
> there any simple way of implementing these as associative arrays and 
> importing/exporting the data.  In the worse case a db file could 
> consist of 200,000 lines of about 20 chars each!  Most files will 
> have 1000-5000 lines of 20-250 chars.

The best way to do this depends mostly on how often you need to search
that data.  If only occasionally, you're probably better off just
keeping the data in a custom property and using offset() or
lineOffset() to do the lookups.  Using associative arrays is mostly
useful if you have to do a lot of lookups quickly, or if the data is
compressed in the process of indexing (as in the word-count example).
Arrays, like fields, are relatively inefficient at storing large
amounts of textual data because it expands some when stored this way.
  Regards,
    Scott

> Thanks for any help
> Peter
> --------------------------------------------------------
> Peter Reid
> Reid-IT Limited, Loughborough, Leics., UK
> Tel: +44 (0)1509 268843 Fax: +44 (0)870 052 7576
> E-mail: [EMAIL PROTECTED]
> Web: http://www.reidit.co.uk
> 
> This is the MetaCard mailing list.
> Archives: http://www.mail-archive.com/metacard%40lists.best.com/
> Info: http://www.xworlds.com/metacard/mailinglist.htm
> 

********************************************************
Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...


This is the MetaCard mailing list.
Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm

Reply via email to