Multiline code on IRB?

Discussion in 'Ruby' started by Rubist Rohit, Nov 16, 2010.

  1. Rubist Rohit

    Rubist Rohit Guest

    I am trying to write a multi-line small code in IRB, but it has no
    option to come to the next line.

    --
    Posted via http://www.ruby-forum.com/.
    Rubist Rohit, Nov 16, 2010
    #1
    1. Advertising

  2. On Tue, Nov 16, 2010 at 11:45 PM, niklas | brueckenschlaeger
    <> wrote:
    > When you write a line that isn't finished (e.g. end a line with a
    > semicolon) ;
    > or write a "do" with no "end" do
    > =A0it won't evaluate it until you finish it
    > end


    In all other cases you can escape the line ending the same way as in a scri=
    pt:

    irb(main):001:0> 5 \
    irb(main):002:0* + 3
    =3D> 8
    irb(main):003:0>

    Kind regards

    robert

    --=20
    remember.guy do |as, often| as.you_can - without end
    http://blog.rubybestpractices.com/
    Robert Klemme, Nov 17, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    547
    Jim Sizelove
    Dec 3, 2004
  2. Sam Stephenson
    Replies:
    1
    Views:
    215
    Andrew Walrond
    Jun 18, 2005
  3. Replies:
    1
    Views:
    151
    Florian GroƟ
    Oct 26, 2005
  4. anne001
    Replies:
    1
    Views:
    257
    anne001
    Jun 27, 2006
  5. dale zhang
    Replies:
    8
    Views:
    407
    Tintin
    Nov 30, 2004
Loading...

Share This Page