getcell basics

Aug 5, 2009 at 9:58am

getcell basics

Hi,

I’m trying to get the value in a given cell.
Does anyone know how to achieve this?
Details are joined.

function whichval()
{
var asd = arrayfromargs (arguments);
asd = mtrx.getcell();
outlet(0, asd);
}

/*
function whichval(v)
{
var asd = mtrx.getcell(v);
outlet(0, asd);
}
*/

#45017
Aug 5, 2009 at 4:46pm

woh! thread read by more than one thousand users and no idea how to use getcell from inside JS ?

#162199
Aug 6, 2009 at 8:18am

Hello,

y’a pas l’feu au lac ! Wink

nota bene :
arrayfromargs (arguments) return an Array ; so this array should be used as values for matrix.getcell () function.

function toto ()
{
var k, result ;
k = arrayfromargs (arguments) ;
result = matrix.getcell (k[0], k[1]) ;
outlet (0, result[0]) ;
}

why result[0] ? look inside the zip !

#162200
Aug 6, 2009 at 11:01am

> outlet (0, k[0]) ; // getcell retourne un objet dont la propriété [0] est le nombre désiré.

However, if I don’t put the [0], I get the same result:

function passmoilsel (a)
{
var k = mtrx.getcell (a, 0) ;

outlet (0, k) ; //gives the value as it should
}

Merci encore, je prends un vrai cours … nécessaire.

#162201
Aug 6, 2009 at 3:44pm

Hello,

Oops, works without [0] ? Super : it seems outlet do it automaticaly ; most of times i have to try several stuff before to find the good way. Wink

#162202
Aug 7, 2009 at 8:12am

Hello,

ok, it’s working without [0] because getcell() return an Array (length as matrix number of planes) ; so with one plane you have one value – post() and outlet() automaticaly translate Array -, but take care with more planes you will have more values…

(In javascript an Array is an Object, sometimes confuse, zip about that).

#162203

You must be logged in to reply to this topic.