From: Todd Date: 2005-11-09T05:37:12+09:00 Subject: Re: ASCII code thing...what gives? Dale Martenson wrote: > > irb(main):001:0> ?T > > => 84 > > The '?' operator returns the ascii code of the character > > > irb(main):002:0> "\84" > > => "84" > > I think this is evaluated as "\8" and "4". "\x" returns "x" so "84" > makes sense. > > Note: there is no decimal substitution only "\nnn" (octal) and "\xnn" > (hex). > > > irb(main):003:0> "\124" > > => "T" > > This matches the octal form a substitution so it is correct. > > > irb(main):004:0> "\124\84" > > => "T84" > > As previously shown the first part matches the octal substitution > "\124" => "T". The second part matches "\8" + "4" => "84". Thus "T84" > is correct. Yes, thanks to everyone for the quick response. I don't even know where I originally heard of the "\nn" operator, so couldn't find the doc on it (maybe Pickaxe?). my_num.chr will work perfect. Thanks again, Todd