From: Anna Vester Date: 2012-12-03T08:54:50+09:00 Subject: Re: If statement --0016e6d7eaac91e12e04cfe6fbbe Content-Type: text/plain; charset=ISO-8859-1 Masoud, I don't believe you need to interpolate the op, you can just use op, for example: if op == "Q" Hope this helps, Anna On Sun, Dec 2, 2012 at 4:43 PM, Masoud Ahmadi wrote: > puts("give me the command to execute or press Q to quit") > op=gets > if "#{op}" == "Q" > then > Kernel.exit(0) > else > value = `#{op}` > puts "#{value}" > end > --0016e6d7eaac91e12e04cfe6fbbe Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Masoud, I don't believe you need to interpolate the op, you can just us= e op, for example:

if op =3D=3D "Q"=A0

Hope this helps,

Anna

On Sun, Dec 2, 2012 at 4:43 PM, Masoud Ahmadi <lists@ruby-forum.com= > wrote:
puts("give me the command to execute or press Q to qu= it")
=A0 =A0 =A0 op=3Dgets
=A0 =A0 =A0 if "#{op}" =3D=3D "Q"
=A0 =A0 =A0 =A0 then
=A0 =A0 =A0 =A0 Kernel.exit(0)
=A0 =A0 =A0 else
=A0 =A0 =A0 =A0 value =3D `#{op}`
=A0 =A0 =A0 =A0 puts "#{value}"
=A0 =A0 =A0 end

--0016e6d7eaac91e12e04cfe6fbbe--