array info request

Lynch, Jonathan bnz2 at cdc.gov
Mon Jul 25 16:23:30 EDT 2005


In my opinion, the easiest way to do what you want is to have a separate
customproperty set for each column.
You can access the records as:

Record[1], title[1], ISBN[1] etc...

You can also do something like:

myRecords[Record,1] 
myRecords[title,1]
etc...

if you want to think of it as a multidimensional array. I just think the
first method winds up being easier, quicker, and less confusing.



-----Original Message-----
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of keith
Sent: Monday, July 25, 2005 4:16 PM
To: How to use Revolution
Subject: Re: array info request

>>>The internal order in which keys are stored in a custom prop is not
>>>sorted alphabetically

>>Oh boy...

>It's often not so bad. Associative arrays are often addressed by the 
>key name, so sequential order wouldn't affect that one way or 
>another.
>
>If you need sequential access you can use numeric keys.

Ermm... :-)

Okay, in my state of blissful ignorance I had assumed that arrays 
were effectively arranged in a spreadsheet-like manner. The array 
name is the spreadsheet (in this way of thinking), the keys are like 
a set of column headings, and the elements are the bits of data in 
each cell. I hope I'm not too off-target here! <g>
Anyway, an example of data in this layout, assuming it isn't just
bonkers:

Record   Title   ISBN   Author   Editor  Comments
1        ABC	 123	Tim	 Tom     Lots of blahblah...
2        House   345    Mick     Mark    Different blahblah...

Can I extract every record number and title in order to search for 
just titles? (I'm imagining that I'd need to know which record ID a 
found item was in to be able to pull the full record.)


The rough idea in my head right now is to store the data in an array 
in a project:

* People read it, showing one record at a time by either clicking 
through sequentially or by searching for specific things. The 
elements from that record are retrieved from the array and put into 
the right fields as each record is shown.

* If someone wants to edit a record a flag is set in its part of the 
array so others can't do the same to that record. When editing is 
done, the different fields are written back to their respective 
elements in the array.

* New records are made by writing new 'lines' in the array. They are 
then available for others to come across as they browse the data 
collection.

In the opinion of those that have tried this sort of thing and/or 
worked with arrays, is this a moderately sensible approach?

the ever-learning k
(who's wife is waiting for a magic solution to the problem. Doh! :-)
_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list