max() of a variable?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

max() of a variable?

rothloup
I have a few vectors defined in my SCAD file, and I need to assign the min and max values in each vector a variety of variables.  However, my code always returns "undef" for the variable values if I reference the vector in the argument list - it only seems to work if I explicitly type in hard-coded values!  

How do I get the max and min values of a vector?

If this only works with hard-coded values, then it seems eminently useless.  What's the point of a function that can't take referenced arguments?  I might as well just hardcode the result.  I hope I'm just having trouble with the syntax.

Thanks!

Code:
vector = [1, 2, 3];

var = max(vector);
echo("This doesn't work: ", var);
echo("Neither does this: ", max(vector));
echo("But this does??: ", max(1,2,3));

Output:
ECHO: "This doesn't work: ", undef
ECHO: "Neither does this: ", undef
ECHO: "But this does??: ", 3
Reply | Threaded
Open this post in threaded view
|

Re: max() of a variable?

Oskar
Have you tried a recent developer snapshot? I think I added support for max() and min() of vector arguments a while ago.
Reply | Threaded
Open this post in threaded view
|

Re: max() of a variable?

Bananapeel
In reply to this post by rothloup
It works fine in version 2014.11.07.

:)
Reply | Threaded
Open this post in threaded view
|

Re: max() of a variable?

rothloup
This post has NOT been accepted by the mailing list yet.
In reply to this post by Oskar
hunh.  worked perfectly.  thanks, Oskar.

Looks like there is a large delta between the developer snapshot and the stable release - the UI looks very different, quite improved!

I initially stayed away from the development release because I didn't want to open myself up to "bleeding edge" headaches - but it looks like I need to use it in this case.  

Thanks!