From: Josef 'Jupp' Schugt Date: 2003-03-18T08:49:45+09:00 Subject: Accessing hash values sorted by their keys Is an elegant way of doing this? h.keys.sort.each { |key| puts h[key] } works but seems unneccarily complicated. Is there some analogy to the following Fortran 90 snipplet? DIMENSION a (30, 40), i (5) PARAMETER (i = (/5, 10, 15, 20, 25 /) ) x1 = a(1, :) x2 = a(10, 2:40:2) x3 = a(1:10, 2:40:2) x4 = f(2, i) ! x1 through x4 are arrays ! x1 is 1st row of a ! x2 is every 2nd element of the 10th row starting with 2nd element ! x3 is every 2nd element of rows 1 through 10 " " " " ! x4 is elements 5, 10, 15, 20, 25 of 2nd row 'h.sort[*][1].each' would be great... Josef 'Jupp' Schugt -- jupp (AT) gmx (DOT) de :. .....: ::..........:::::: http://jupp.tux.nu :::::::::::::::::: '''''''''' dxm