Set minimum and maximum of newly created flonum

Frans-Jan Wind's icon

Hello,

When I create a flonum with javascript like this:

theflonum = this.patcher.newdefault(300, 300, "flonum");

I can give it a scriptingname:

theflonum.varname = "flonum[0]";

But why can't i give it a min and max value? I tried:

theflonum.minimum = 0.;
theflonum.maximum = 1.; //With and without parenthes

and

theflonum.min = 0.;
theflonum.max = 1.; //With and without parenthes

I got the names from the attributes list (ctrl click on a inlet)

I'm using Max 5.0.5 on MacOS 10.5.4

jayrope's icon

spent a whole day with a syntax problem like this yesterday.

try

theflonum.message('min', 0);
theflonum.message('max', 1);

and make sure you send this, after you created and wired theflonum.

jrp

Frans-Jan Wind's icon

Thanks, this works perfect!

swieser1's icon

Does it work if you try:

theflonum.min = 0;

i.e. without the period after the zero. This is a common way to denote a float in max, although i'm not sure if js likes it.

Frans-Jan Wind's icon

Id did try that, but it doesn't work.