Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Sorting an NArray
mekondelta
12/28/2006 3:46:00 PM
I have a 2 dimensional array using NArray and wish to sort the values based
on the values in column zero or row zero.
How can I achieve this using NArray? I can't even seem to get the basic sort
working:-
matrix.sort(0)
gives me a "..blah..:in `sort': undefined method `<=>' for nil:NilClass
(NoMethodError)"
I know I can supply a block to the sort method but the documentation, such
that it is at:-
http://narray.rubyforge.o...
isn't that informative and implies that the above line should work?
Any ideas greatly appreciated.
Cheers, Chris.
--
View this message in context:
http://www.nabble.com/Sorting-an-NArray-tf2890826.htm...
Sent from the ruby-talk mailing list archive at Nabble.com.
1 Answer
Ara.T.Howard
12/28/2006 4:35:00 PM
0
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Sorting an NArray
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password