From: RK Sentinel Date: 2009-01-17T20:24:51+09:00 Subject: Re: Son of 10 things! (1.8 to 1.9 transition) F. Senault wrote: > Le 17 janvier 2009 � 06:35, RK Sentinel a �crit : > >> (ord(), iirc). ?\C-a.ord(). > To can also convert ch (a few keystrokes less) : > > case ch.chr > when ?\C-a ... > > On the other hand, the use of ':' with when is also deprecated, IIRC. > > Fred ch.chr only works for values < 256. After that it gives an out of range. I very often trap Ncurses' keys such as KEY_UP DOWN, RIGHT and LEFT. They won't work in this case. Same for function keys etc. (Yes, I was quite surprised to see the ":" deprecation in David's article (i had missed it elsewhere), I use it frequently in case statements, I thought it was good style to use it.) -- Posted via http://www.ruby-forum.com/.