how to determine current position in a program?? [message #58139] |
Tue, 22 January 2008 09:46 |
astroboy2k
Messages: 34 Registered: July 2007
|
Member |
|
|
Hello.
I was wondering if anyone would offhand have any idea of how to go
about determining which line number a program is at at a certain time.
That is to say, I would like a program to print a message something
like "at line 1234", where 1234 is the actual line number in the code.
For example, I'd originally have:
pro junk,xxx
print,'1'
print,'2'
print,'you are now at this line in the code ',3
return
end
Of course, I'd want to modify the code endless times to get something
like:
pro junk,xxx
print,'1'
print,'2'
x=0. ;line 3
x=x+1. ;line 4
print,'you are now at this line in the code ',some_function()
return
end
That is to say, I'd like have some_function() return the number 5,
since it's being called at line 5 in the code. I don't want to
constantly have to be changing my print statements, in other words.
When programs crash you get an output to the effect that things came
to a halt at such and such a line in one unit or another, so it seems
like IDL might have the capability of knowing which line of a code is
being executed at any given time.... Does anyone know if this can be
done without too much pain and anguish......
Thanks all,
Mark
|
|
|