Arrays in Rev

Mark Brownell gizmotron at earthlink.net
Sun Jul 11 17:38:07 EDT 2004


on 7/11/04 1:57 PM, Troy Rollins at troy at rpsystems.net wrote:

> On Jul 11, 2004, at 4:15 PM, Mark Brownell wrote:
> 
>> I came from Director also and missed lists so much that I created my
>> own.
> 
> Very cool. Downloaded, and will play with this tonight.
> 
> I can extrapolate then that Rev (Transcript) does not then actually
> have a decent way to do this natively?

No, sort of. The dimensionalList.rev example came after I decided that a
pull-parser version of a single row & column table was only two dimensional.
It does not take a great leap to see that anyone could create a key handler
that transforms "myArray[1][1][2]" into a key named "1,1,2" to be used in
any array. I use the pull-parser with the text version because it's also an
external text based storage file.

I've been dreaming of the day that a high speed pull-parser was added to Rev
for these two reasons of using text based dimensional lists.

If I had a parser that created a numerical array like this example:
-- put getPNLPelements("<record>", "</record>", yourTextData) into theArray
function getPNLPelements tStartTag, tEndTag, StringToSearch

and a single element parser that grabbed elements from smaller chunks of
text containing pages of markup for example:

-- put PNLPgetElement("<price>", "</price>", theArray[32]) into theElement
function PNLPgetElement tStTag, tEdTag, stngToSch

Then I could build a multi-dimensional function that could rival the speed
of lists in Director. Those lists could be storage devices as well as a
single text document.

> 
> And, have you done any speed tests? As you know, lists are very fast in
> Director. I'm assuming these methods in your stacks are faster than
> accessing similar data from fields, etc. as it is variable based?

It's pretty fast on 1 meg data objects. You can even store and gather
compressed(base64) data between tag sets that can be rebuilt as images. Rev
is so cool when it comes to transforming information.

Mark



More information about the use-livecode mailing list