I prepared this, then got sidetracked, but broadly, since I'd done it and it also mentions the value of the RevUp article by Tom Healy, I'll post it anyway. It also shows that there is a possible rethink about the metadata elements needed, as Phil uses 1045 and 0000 like row and column values (which may be more appropriate, depending on what you need).
You can think of the x,y coordinates as a row number and a column index in this case, each being one element of the 3 level array. Each level of the array can have its own set of values for each key. (Not making myself very clear, I know - skip to the RevUp article for much better understanding!)
So you could
Code: Select all
put 1045 into mapA[1][1]["metadata1"]
put "0000" into mapA[1][1]["metadata2"]
put TRUE into mapA[1][1]["metadata3"]
put 1045 into mapA[1][2]["metadata1"]
put "0000" into mapA[1][2]["metadata2"]
put TRUE into mapA[1][2]["metadata3"]
put 1045 into mapA[1][3]["metadata1"]
put "0000" into mapA[1][3]["metadata2"]
put TRUE into mapA[1][3]["metadata3"]
put 1045 into mapA[2][1]["metadata1"]
put "0000" into mapA[2][1]["metadata2"]
put TRUE into mapA[2][1]["metadata3"]
put 1045 into mapA[2][2]["metadata1"]
put "0000" into mapA[2][2]["metadata2"]
put TRUE into mapA[2][2]["metadata3"]
put 1045 into mapA[2][3]["metadata1"]
put "0000" into mapA[2][3]["metadata2"]
put TRUE into mapA[2][3]["metadata3"]
put 1045 into mapA[3][1]["metadata1"]
put "0000" into mapA[3][1]["metadata2"]
put TRUE into mapA[3][1]["metadata3"]
put 1045 into mapA[3][2]["metadata1"]
put "0000" into mapA[3][2]["metadata2"]
put TRUE into mapA[3][2]["metadata3"]
put 1045 into mapA[3][3]["metadata1"]
put "0000" into mapA[3][3]["metadata2"]
put TRUE into mapA[3][3]["metadata3"]
You can of course make this more efficient in code lines by looping through to set the variable data.
Now say you wanted to get the value stored in the third metadata item of coordinate 2,1 (which should be "TRUE"). You can
You may find it much more easy to follow and more natural/powerful/flexible if you understand that in RunRev arrays are "hash tables" and not necessarily numerically indexed. So you could have
Code: Select all
put "bread,cheese" into recipeA["Cheese on Toast"]["ingredients"]
put "egg" into recipeA["Boiled Egg"]["ingredients"]
A much better example, with deeper levels is in this RevUp article by Tom Healy:
http://runrev.com/newsletter/september/ ... etter1.php
HTH,
SparkOut