Well I never!

Jim Ault jimaultwins at yahoo.com
Sat Mar 28 01:26:43 EDT 2009


A simple example we all know...

I live in an array called a "house"
It contains rooms thus
house[bedroom]
house[kitchen]
---my kitchen contains a refrigerator with shelves and a freezer
house[kitchen][refrigerator][top shelf]"cheese, pickles, butter"
house[kitchen][refrigerator][freezer]"green peas, ice cream, ice trays"
---my bedroom has stuff, but no freezer
house[bedroom][closet][shoebox 1] "black dress shoes"
house[bedroom][closet][hook 4] "brown leather belt"
house[bedroom][closet][hanger 12] "fancy dress sweatshirt"
house[bedroom][closet][all other hangers] "wife's clothes"
house[bedroom]"bed"
house[bedroom]"left-side lamp"
house[bedroom][night table][top drawer][medicine tray][asprin bottle] 
[tablets count] 24
house[bedroom][night table][top drawer][medicine tray][asprin bottle] 
[tablets color] "white"
house[bedroom][night table][top drawer][medicine tray][asprin bottle] 
[cotton count] 1
house[bedroom][night table][top drawer][medicine tray][asprin bottle] 
[price sticker][text] "$1.98"
house[bedroom][night table][top drawer][medicine tray][asprin bottle] 
[price sticker count] 1
house[bedroom][night table][top drawer][medicine tray][asprin bottle] 
[label][readable text] 2%

This type of array does not have to be defined ahead of time, since  
all data types qualify.  In fact, in Rev, binaries are good.  So how  
many databases can fit into the head of an array?

house[sewing room][storage basket][straight pin][head]  
allAdultsNamedAngelUSA2008.zip
This is one of the infinite answers to the question..  "How many  
angels can fit on head of a pin?"

(ok, its late, its Friday)

Jim Ault
Las Vegas


On Mar 27, 2009, at 9:55 PM, James Hurley wrote:Trevor,
>
> Thank you for this thoughtful (and thought provoking) response.
>
> But you give me too much credit. I apparently haven't grasped even  
> the fundaments. For example I do not understand what is expressed in:
>
> "mdArray[1]["Children"][1]["Name"]
>
> I have found this in the Docs:
>
> "Array elements may contain nested or sub-elements, making them  
> multi-dimensional.
> This type of array is ideal for processing hierarchical data  
> structures such as trees or
> XML. To access a sub-element, simply declare it using an additional  
> set of square
> brackets.
> put "ABC" into myVariable["myKeyName"][“aChildElement”] "
>
> Which suggests a structure and notion which is quite different from  
> the example you gave. Why not just mdArray["Children"]["Name"] .  
> Where does the "1" do for you?
>
> You must be sorry you started this. As you can see I am at a loss. I  
> am stuck back in an era when arrays were just tensors.
>
> And I feel it is not unfair to say that the documentation has not  
> caught up with this new feature of Run Rev. But I understand. It is  
> so much more fun to do stuff than explain it.
>
> Jim Hurley
>
>
>
>
> _______________________________________________
> 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