Arrays in Rev (long)

Troy Rollins troy at rpsystems.net
Sun Jul 11 17:51:17 EDT 2004


On Jul 11, 2004, at 5:16 PM, Ken Ray wrote:

> LINEAR LISTS
> ------------
>
> The simple linear lists in Director are straightforward - compare:
>
> Director:
>   set myList = ["Troy","Ken","Richard"]
>   put getAt(myList, 2)
>   --> Ken

Or in "modern dot-lingo" -
put myList[2]

> More complex linear lists compare this way:
>
> Director:
>   set myList = [["Troy","Ken","Richard"],["Kevin","Jan","Judy"]]
>   put getAt(myList,2)
>   --> ["Kevin","Jan","Judy"]
>   put getAt(getAt(myList,2),1)
>   --> Kevin

again, Director's syntax for lists is more refined than that -
put myList[2][1]

> Anyway, now I'm rambling... I hope this has been helpful to both you 
> and
> anyone else paying attention. ;-)

Very awesome dissertation. While Director's techniques for array 
handling are probably the only reason that I perceive it as lacking in 
Transcript, this has certainly helped me to understand Rev's 
under-the-hood approach to them. Adding CRs, and doing splits somehow 
seems a bit less than straightforward, as you must then do mental 
translation from string lines, etc. in order to develop appropriate 
paths to data. Plus, every example you've shown is based on knowing 
where the data is in the first place - it gets even more complex when 
one must search within the array for data, and then do a relational 
path to associated data, no? At some point, the advantages to 
multi-dimensional arrays would seem to fall by the wayside, 
overshadowed by array handling complexity.

I DO hope that more advanced array handling gets included in a Rev 
update (and soon.) In Director, it is second nature. In Rev, I'm not 
sure that I'll use them in their current state, beyond simple flat 
arrays. I plan to look at Mark and Dar's solutions to see how they 
actually fill the gap. I think deep arrays and list handling have 
become too intrinsic to my coding techniques to give up on them 
altogether.

Aside from all that, THANK YOU.
--
Troy
RPSystems, Ltd.
http://www.rpsystems.net



More information about the use-livecode mailing list