Printing Line number during runtime

A

Ash Paratal

Hi All,

I am a newbie to ruby programming, Is there a way to print the line
number of the code that ruby is interpreting during runtime without
changing my code?
Can I see what line is ruby running currently?
Is there a command line option?

Thanks in advance!
 
A

Arul hari

Ash said:
Hi All,

I am a newbie to ruby programming, Is there a way to print the line
number of the code that ruby is interpreting during runtime without
changing my code?
Can I see what line is ruby running currently?
Is there a command line option?

Thanks in advance!

hai friends,
You can use like this ,it will tell the line number exactly.
Other than that I have not findout any method.wherever you are giving
the the varibales ,it will tell the current line number.

print __LINE__

by
vellingiri.
 
R

Robert Klemme

2007/10/22 said:
Hi All,

I am a newbie to ruby programming, Is there a way to print the line
number of the code that ruby is interpreting during runtime without
changing my code?
Can I see what line is ruby running currently?
Is there a command line option?

No, but you can cook something up with set_trace_func.

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

Forum statistics

Threads
474,269
Messages
2,571,338
Members
48,025
Latest member
Rigor4

Latest Threads

Top