Arrays in Rev (long)

Rob Cozens rcozens at pon.net
Mon Jul 12 09:50:13 EDT 2004


>A temporary  stack as an advanced multi-dimensional variable? If 
>this is the case, I  think I like that much better than trying to 
>force my own metaphor down  the throat of Rev by trying to create 
>multidimensional arrays inside  something which really has no 
>support for them.

Troy, et al:

Rev can support non-keyed multidimensional arrays using multiple 
delimiter characters.

Three-dimensional example:

on putValue thevalue, at theArray,xcoord,ycoord,zcoord,xdelim,ydelim,zdelim
    set the itemDelimiter to xdelim
    put item xcoord of theArray into firstLevel
    set the itemDelimiter to ydelim
    get item ycoord of firstLevel
    set the itemDelimiter to zdelim
    put theValue into item zcoord of it
    set the itemDelimiter to ydelim
    put it into item ycoord of firstLevel
    set the itemDelimiter to xdelim
    put firstLevel into item xcoord of theArray
end putValue

functyion getValue theArray,xcoord,ycoord,zcoord,xdelim,ydelim,zdelim
    set the itemDelimiter to xdelim
    get item xcoord of theArray
    set the itemDelimiter to ydelim
    get item ycoord of it
    set the itemDelimiter to zdelim
    return item zcoord of it
end getValue

-- 

Rob Cozens
CCW, Serendipity Software Company

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)


More information about the use-livecode mailing list