On 2013-06-23, at 5:03 PM, Mike Stok <mike / stok.ca> wrote:

> On 2013-06-23, at 2:51 PM, "Michael P F." <lists / ruby-forum.com> =
wrote:
>=20
>> I want to input the variable, which changes, from the console and=20
>> evaluate multiple examples without entering the constant multiple =
times.
>>=20
>> --=20
>> Posted via http://www.ruby-forum.com/.
>=20
> Do yo mean something like this (which uses the highline gem to prompt =
for input and coerce it to the right  type):
>=20
> #!/usr/bin/env ruby
>=20
> require 'rubygems'
> require 'highline/import'
>=20
> CONST =3D 28977682.9
>=20
> begin
>  loop do
>    num =3D ask("Enter number: ", Float)
>    puts CONST * num

Oops, that * should be a /.

>  end
> rescue EOFError
>  puts "Bye!"
> end
>=20
> __END__
>=20
> Hope this helps,
>=20
> Mike
>=20
>=20
> --=20
>=20
> Mike Stok <mike / stok.ca>
> http://www.stok.ca/~mike/
>=20
> The "`Stok' disclaimers" apply.
>=20
>=20
>=20
>=20
>=20
>=20

--=20

Mike Stok <mike / stok.ca>
http://www.stok.ca/~mike/

The "`Stok' disclaimers" apply.