We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Reference, Sort (Read 1316 times)
Reference, Sort
Jul 22nd, 2009, 8:18am
 
http://processing.org/reference/sort_.html

> s = sort(s, 3);
> println(s);  // Prints bear, dear, elephant on separate lines

Above suggests, that s.length == 3, while before sort it was 5.

> For example if there are 12 elements in an array and if count is the
> value 5, only the first five elements on the array will be sorted

And this suggests, that s.length == 12 (doesn't change), but only the first 5 elements will be sorted.

From what I found out, the second definition is correct, so the example should say:

> s = sort(s, 3);
> println(s);  // Prints bear, dear, elephant, aardvark, cat on separate lines

Re: Reference, Sort
Reply #1 - Oct 18th, 2009, 9:13am
 
Thank you! That's correct. It will be fixed for the next update.
Page Index Toggle Pages: 1