Array Basics

Jeanne A. E. DeVoto revolution at jaedworks.com
Wed Feb 25 15:24:58 EST 2004


At 9:48 AM -0600 2/25/2004, Bojsza wrote:
>1. What is the difference between an array and a matrix?

There's no basic difference; a matrix is a particular kind of array. 
(Specifically, a matrix is a two-dimensional array with one-based 
numeric keys.)

>[...]
>   put "2 3 4" into zArray -- create a 1x3 array
>matrixMultiply(xArray,zArray)
>put it into arrayOut
>end mouseUp
>
>The script editor errors with the following:
>
>Expression: missing ' ) ' before factor.

The problem is that matrixMultiply is a function, not a command, so 
it needs to be embedded in a statement that uses the function. 
Instead of
   matrixMultiply(xArray,zArray)
   put it into arrayOut
try
   put matrixMultiply(xArray,zArray) into arrayOut

>2. I know that I can go from a list to an array with the split 
>command. Can I go from an array to a list also using the split 
>command?

For this, use the combine command (which is the converse of split).

>3. Can I create an array with a variable ie a 3x1 array with angle 
>as a variable?

Not sure what you mean here - can you say more about what you want to do?
-- 
jeanne a. e. devoto ~ jaed at jaedworks.com
http://www.jaedworks.com


More information about the use-livecode mailing list