From: Eero Saynatkari Date: 2006-10-18T12:10:07+09:00 Subject: Re: Newbie: Ruby and Writing Variables In Strings --IJKqlw44nclc26Ih Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2006.10.18 11:46, Lovell Mcilwain wrote: > Converting my variables to string got my program to the point where its= =20 > asking for my input. Once I put it in, it bails on me with a comparison= =20 > error. >=20 > 99 bottles of beer on the wall, 99 bottles of beer. Take one down pass= =20 > it around > 98 > 99bottles.rb:15:in `>': comparison of String with 99 failed=20 > (ArgumentError) > from 99bottles.rb:15 This problem is because you cannot say 99 > "6". input =3D gets puts 'true' if input.to_i < 99 For example. You must use explicit conversion in most cases in Ruby. --IJKqlw44nclc26Ih Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFNZp97Nh7RM4TrhIRAuvsAKCyppw4ocO5EPMJeWsdfDCLpujBgACgnHSS 1EUTX9Jlg1ioqWvPbONwxjQ= =CehJ -----END PGP SIGNATURE----- --IJKqlw44nclc26Ih--