Simple Arrays

Michael Kann mikekann at yahoo.com
Sun Jan 10 12:42:26 EST 2010


Jim, thanks for the fresh eyes. My example does differ. I'll give their version a try. When I tested the -- myArray[1,1] --  format earlier I couldn't get it to work -- maybe it was just me. I do agree that the arrays in RunRev aren't that useful when you have the chunk expressions that are so convenient. I guess you need arrays for custom properties, but I never use them, either.

Thanks for the reply.



--- On Sun, 1/10/10, Jim Ault <jimaultwins at yahoo.com> wrote:

> From: Jim Ault <jimaultwins at yahoo.com>
> Subject: Re: Simple Arrays
> To: "How to use Revolution" <use-revolution at lists.runrev.com>
> Date: Sunday, January 10, 2010, 11:34 AM
> Yours is not the same syntax as the
> example in the docs
> 
> put  1 into myArray[1][1]
> put  2 into myArray[1][2]
> put  3 into myArray[2][1]
> put  4 into myArray[2][2]
> 
> theirs
> put  1 into myArray[1,1]
> put  2 into myArray[1,2]
> put  3 into myArray[2,1]
> put  4 into myArray[2,2]
> 
> But theirs does not make sense to me, since "1,1" is like
> "1comma1" or "1a1" if all keys are strings (except when they
> fall into a special category of sequential integers)
> Sorry I could not be of more help, but I long ago regarded
> arrays in Rev as NOT useful mathematical constructs.
> 
> There is no ReDim or ReDim preserve in Rev arrays.
> 
> Jim Ault
> Las Vegas
> 
> On Jan 10, 2010, at 9:23 AM, Michael Kann wrote:
> 
> > Jim, thanks for the info. I'm really learning a lot
> sitting here in the coldest room in the house with the
> little electric heater blowing in my face. How's it in Las
> Vegas?
> > 
> > Thanks for weaning me of the Excel model of transpose.
> I was going by the RunRev dictionary. Since I can't get
> transpose to work using almost the exact same example they
> used I assume I am missing something obvious or the docs
> need revision. Let's see what the dictionary has to say and
> see if we can get something working.
> > 
> > Thanks again Jim for all your help.
> > 
> > Mike
> > 
> >
> -------------------------------------------------------------------
> > -- the dictionary entry for transpose:
> >
> -------------------------------------------------------------------
> > Comments:
> > A two-dimensional array is an array whose elements
> have a two-part key to describe them. You can visualize such
> an array as a set of rows and columns: the first part of
> each element's key is the row number, and the second part is
> the column number. For example, the expression myArray[3,2]
> describes the element of myArray which is in the third row,
> second column.
> > 
> > The transpose function simply swaps rows for columns.
> In other words, for each element in the array, the
> corresponding element in transpose(array) has its two parts
> switched one for the other. The value in the third row,
> second column is moved to the second row, third column.
> > 
> > The transpose function is its own inverse: you can
> transpose a transposed array again to recover the original
> array.
> > 
> >  Important!  If the array has missing
> elements, the transposefunction will fail to work. For
> example, an array that contains elements myArray[1,1],
> myArray[1,2], and myArray[2,2] cannot be transposed because
> the element myArray[2,1] is missing.
> >
> -------------------------------------------------------------------
> > 
> > --- On Sun, 1/10/10, Jim Ault <jimaultwins at yahoo.com>
> wrote:
> > 
> >> From: Jim Ault <jimaultwins at yahoo.com>
> >> Subject: Re: Simple Arrays
> >> To: "How to use Revolution" <use-revolution at lists.runrev.com>
> >> Date: Sunday, January 10, 2010, 11:05 AM
> >> An array with one key and one element
> >> (value) is two dimensions
> >> 
> >> myArray[1][1]   is three dimensions
> ( two
> >> keys and one element )
> >> 
> >> Again, Rev uses associative arrays.
> >> Transpose means switching the numeric *values* for
> the
> >> numeric
> >> *keys*.  The keys must be sequential.
> >> 
> >> Excel transpose does not meant the same thing.
> >> Excel array notation and functions operate
> differently.
> >> 
> >> Rev would use a 'table' with
> >>       item j of line i of
> tabularData
> _______________________________________________
> 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