# How i can jump from one line to another line

**URL:** <https://www.ruby-forum.com/t/how-i-can-jump-from-one-line-to-another-line/179379>\
**Category:** Ruby\
**Created:** [November 23, 2009, 9:58pm UTC](https://www.ruby-forum.com/t/how-i-can-jump-from-one-line-to-another-line/179379 "2009-11-23T21:58:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sql\_injection](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@sql\_injection](https://www.ruby-forum.com/u/sql_injection)\
**Post date:** [November 23, 2009, 9:58pm UTC](https://www.ruby-forum.com/t/how-i-can-jump-from-one-line-to-another-line/179379/1 "2009-11-23T21:58:22Z")

</div>

hi  
How i can jump from one line to another line ??

for exaple i have 7 line codes like here:

line 1: code  
line 2: code  
line 3: code  
line 4: code  
line 5: code  
line 6: code  
line 7: code

no i wanna know when line 3 will be runing how after there my propmt  
jumping to line 6 ?

thank you so maaaaaachhhhhhhhhhhhh

---

<div class="post-metadata">

**Author:** ![sql\_injection](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@sql\_injection](https://www.ruby-forum.com/u/sql_injection)\
**Post date:** [November 24, 2009, 8:07am UTC](https://www.ruby-forum.com/t/how-i-can-jump-from-one-line-to-another-line/179379/2 "2009-11-24T08:07:13Z")

</div>

hiw is here please amswer to meeee

thank you

---

<div class="post-metadata">

**Author:** ![sql\_injection](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@sql\_injection](https://www.ruby-forum.com/u/sql_injection)\
**Post date:** [November 24, 2009, 8:42am UTC](https://www.ruby-forum.com/t/how-i-can-jump-from-one-line-to-another-line/179379/3 "2009-11-24T08:42:36Z")

</div>

You should really work through a basic text on the Ruby language before  
trying to do a specific project.

Bear in mind Ruby is interpreted and it executes as it goes along so  
there are constraints on jumping forward. An if/case statement will take  
you down different routes or you can call previously declared code by  
name (ie def ).

---

<div class="post-metadata">

**Author:** ![sql\_injection](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@sql\_injection](https://www.ruby-forum.com/u/sql_injection)\
**Post date:** [November 24, 2009, 1:36pm UTC](https://www.ruby-forum.com/t/how-i-can-jump-from-one-line-to-another-line/179379/4 "2009-11-24T13:36:30Z")

</div>

2009/11/23 Sajjad S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> How i can jump from one line to another line ??

There is no GOTO in Ruby - fortunately. If this is what you are asking.

> no i wanna know when line 3 will be runing how after there my propmt  
> jumping to line 6 ?

If you always want line 6 to follow line 3 just throw out lines 4 and  
5. For all other cases you need control flow directives, like “if”,  
“else”, “case”, “when” etc. See

[http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut\_expressions.html#S4](http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html#S4)

Kind regards

robert
