From: Wayne Brissette Date: 2011-11-05T21:43:36+09:00 Subject: Re: What happens in dual sorts with nil values? --Apple-Mail=_A000B521-4D0A-4501-B530-C14FC9A0E5F4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 4, 2011, at 6:11 PM, Robert Klemme wrote: >>=20 >> `block in ': undefined local variable or method = `ball_map' for main:Object (NameError) >=20 > Where does "ball_map" come from? It's not in the code you've shown. I tried to make the example something that was a bit more simplistic yet = showed exactly what I was doing instead of the actual code (it's an IC = chip ball map/signal sorting routine). Next time I'll stick to the real = stuff. ;)=20 >=20 >> and second, am I fooling myself into thinking that I'm sorting on = a.age when it's not the first sort value? >=20 > You're not fooling yourself. But the order determines the precedence. > The second field is only evaluated if the first fields are equal and > so forth. >=20 Thanks. I wasn't sure if it failed and since the first sort was done = just didn't put up the error message, thus not really working. But I = suspect since the only time it's coming into play is when signals, in my = case, have the same name so it moves onto their signal value (AB[0], = AB[1] =85 AB[10], etc. ) =85 what I was doing was creating a new array = in the method that held the numbers so AB[10] didn't get placed after = AB[1] in the sort. I was still running into issues during the sort, then = I realized my error yesterday, I wasn't changing the numbers I was = pulling out of the brackets from strings to numbers. Now that I've done = that my sort list works perfectly.=20 As I work my way down the road with Ruby, I can't believe I stayed away = from OOP for so long. I've had a bit of a hard time wrapping my brain = around a few concepts, but some of the cool things I've started to do = with it are saving me tons of time and coding. :) -- So folks, if I = ask what seem like idiotic questions from time to time, it's probably = because I keep falling back to old habits of how I would have done = things instead of how an OOP language handles things.=20 Thanks everybody for your suggestions on this one. =20 Wayne=20= --Apple-Mail=_A000B521-4D0A-4501-B530-C14FC9A0E5F4--