How i can jump from one line to another line

S

Sajjad Seyyed

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
 
M

Mike Stephens

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 <methodname>).
 
R

Robert Klemme

2009/11/23 Sajjad Seyyed said:
How i can jump from one line to another line ??

There is no GOTO in Ruby - fortunately. If this is what you are asking.
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 ?

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

Kind regards

robert
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top