Re: Getting code line numbers? [message #3597] |
Fri, 17 February 1995 01:42 |
sjt
Messages: 72 Registered: November 1993
|
Member |
|
|
Frank J.Oynes (frank@lynx) wrote:
: Hi all,
: Is there asystem variable or similar that keeps track
: of the name of the currently executing function/procedure
: and the current line number within?
: It is reported when an error occurs, so it must be available
: somehow.
: I need it for reporting events/errors/status to a log file
: something like
: log_message(module_name, line_number, 'Warning: The tea is getting cold')
: Clues, anyone?
: Regards,
: Frank J. �ynes
: frank@spacetec.no
HELP, /TRACE ; Sends a traceback to the terminal.
HELP, CALL=VAR ; Puts a reduced tracback in the variable VAR.
So for what you suggest your best bet might be something like:
help, call=calls
log_message(calls(n_elements(calls)-1), Warning: The tea is getting cold')
--
--
+------------------------+---------------------------------- --+---------+
| James Tappin, | School of Physics & Space Research | O__ |
| sjt@star.sr.bham.ac.uk | University of Birmingham | -- \/` |
| Ph: 021-414-6462. Fax: 021-414-3722 | |
+----------------------------------------------------------- --+---------+
|
|
|
Re: Getting code line numbers? [message #3622 is a reply to message #3597] |
Mon, 13 February 1995 03:47  |
knipp
Messages: 68 Registered: January 1993
|
Member |
|
|
In article 95Feb10130718@lynx, frank@lynx (Frank J.Oynes) writes:
>
> Hi all,
>
> Is there asystem variable or similar that keeps track
> of the name of the currently executing function/procedure
> and the current line number within?
>
...
>
>
> Clues, anyone?
>
> Regards,
> Frank J. �ynes
>
> frank@spacetec.no
Try: HELP, CALLS=CALLS
FOR i=0L, N_ELEMENTS(CALLS)-1l DO PRINT, CALLS(i)
K. Knipp
|
|
|