PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Matrices are now an integral part of PPL.

That's right, PPL can use matrices and do multiple operations on them. Here is a list of the supported operators:

+ - * / ^ << >> asl asr shl shr and or xor == <> < > <= >=

Example:

Code:
a$ = [10, 20, [10, 20], 30]; // Convert this matrix to an array (a$).
ShowMessage(a$[0]); // 10
ShowMessage(a$[2][0]); // 10

b$ = [10, 20] + [10, 20]; // [20, 40]
c$ = [10, 30] == [10, 20]; // [1, 0]


I will add support for strings inside matrices tomorrow.
Sorry guys for the lack of pre-release yesterday and today. I want to finish up the matrix routines before I make a build available.

Here is a list of the new matrix functions:

array(matrix$, array$) // convert a matrix to an array.

matrix(array$, matrix$) // convert an array to a matrix format.

mcount(matrix) // return number of elements in matrix

mtype(matrix[x]) // return ET_STRING or ET_MATRIX

madd(matrix, elements) // add elements to matrix

mdel(matrix, index, count) // delete elements from matrix

mins(matrix, index, elements); // insert elements into a matrix

mmid(matrix, index, count) // create new matrix from elements of another matrix

mpos(matrix, element) // find position of an element

mset(matrix, count) // set the number of elements in a matrix

Matrices will have it's own variable type, just like arrays, structures...
Here are some more wicked matrix stuff you will be able to do.

a$ = [10, 20] + 5;
a$ = [10, 20] + [10, 20, 30, 40, 50];
a$ = ["ppl", "rulez"] + [" is cool", " so much"];
a$ = [10, 20] == [10, 15];
a$ = a$ + [20,29];

Strings are an integral part of matrices as well.