comp.lang.ada
 help / color / mirror / Atom feed
* Re: Program identification
@ 1996-08-31  0:00 tmoran
  1996-08-31  0:00 ` Robert A Duff
  0 siblings, 1 reply; 15+ messages in thread
From: tmoran @ 1996-08-31  0:00 UTC (permalink / raw)



>P'Identity which returns a string, P is a program unit
If I understand what you want, how about Ada.Command_Line.Command_Name

>P'Location which returns a string, P is a program unit and the string would
>contain the current line number in the source code, or maybe even the previous
>line number (for exception processing).
  Does Ada.Exceptions.Exception_Information do what you want?

with ada.exceptions;
with text_io;
procedure test is

  bang:exception;

  procedure badguy is
  begin raise bang; end badguy;

begin

  badguy;

exception
  when oops:bang =>
    text_io.put("egad:"
                & ada.exceptions.exception_information(oops)
                & ", whew");
end test;

  produces:

egad:TEST.BANG
   On Line Number 8 In TEST.BADGUY
Called from line number 12 In TEST
, whew




^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Program identification
@ 1996-09-02  0:00 tmoran
  1996-09-03  0:00 ` Joel VanLaven
  0 siblings, 1 reply; 15+ messages in thread
From: tmoran @ 1996-09-02  0:00 UTC (permalink / raw)



>>  produces:
>>
>>egad:TEST.BANG
>>   On Line Number 8 In TEST.BADGUY
>>Called from line number 12 In TEST
>>, whew
>
>On which version of which compiler?  (I want that compiler! ;-))
  RR Software's 3.07 Ada 95.  I forget whether I ran that test on their
DOS/DPMI or Windows 95/NT, but would assume they do the same thing.




^ permalink raw reply	[flat|nested] 15+ messages in thread
* Program identification
@ 1996-08-29  0:00 Chris Sparks
  1996-08-31  0:00 ` Ray Blaak
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Chris Sparks @ 1996-08-29  0:00 UTC (permalink / raw)



Does anyone know of a way to determine the program name within a program
without explictly making a constant for it.  If there isn't a way then
maybe a new attribute should be made for the next version of Ada, namely:

P'Identity which returns a string, P is a program unit

I am using this information as part of an exception reporter system.

BTW these would be helpful too:

P'Location which returns a string, P is a program unit and the string would
contain the current line number in the source code, or maybe even the previous
line number (for exception processing).

Any thoughts?




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~1996-09-15  0:00 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-08-31  0:00 Program identification tmoran
1996-08-31  0:00 ` Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
1996-09-02  0:00 tmoran
1996-09-03  0:00 ` Joel VanLaven
1996-08-29  0:00 Chris Sparks
1996-08-31  0:00 ` Ray Blaak
1996-08-31  0:00 ` Dale Stanbrough
1996-08-31  0:00 ` Robert A Duff
1996-08-31  0:00   ` Ray Blaak
1996-08-31  0:00     ` Robert A Duff
1996-09-02  0:00 ` Stephen & Tammy House
1996-09-03  0:00 ` David C. Hoos, Sr.
1996-09-13  0:00 ` James A. Krzyzanowski
1996-09-14  0:00   ` Ken Garlington
1996-09-15  0:00     ` Larry Kilgallen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox