comp.lang.ada
 help / color / mirror / Atom feed
From: Per Sandberg <per.sandberg@bredband.net>
Subject: Re: Package name as string
Date: Wed, 16 Feb 2011 08:06:45 +0100
Date: 2011-02-16T08:06:45+01:00	[thread overview]
Message-ID: <9IK6p.32469$2t5.26524@newsfe24.ams2> (raw)
In-Reply-To: <a6e2169a-cfab-4ea0-b07c-e22a10193c39@glegroupsg2000goo.googlegroups.com>

Simplest way with GNAT is:

with GNAT.Source_Info;
package body blaa is
    package_name : constant String := GNAT.Source_Info.Enclosing_Entity;
    ...
    ...
end blaa;


On 02/15/2011 07:33 PM, Rego wrote:
> Does someone know a function/package which I get the name of the (other) procedure in use as a string?
>
> I mean, I have a procedure which needs to make a call that returns its own name in a string form:
> --
> with Package_I_Wanna_Know;
> procedure Blabla is
>     I_Want_To_Read_This_String : String;
>
> begin
>     I_Want_To_Read_This_String := Package_I_Wanna_Know.Wanted_Function;
> end Blabla;
> --
> And so, I_Want_To_Read_This_String = "Blabla".
>
> Tks!



  parent reply	other threads:[~2011-02-16  7:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 18:33 Package name as string Rego
2011-02-15 19:16 ` Jeffrey Carter
2011-02-16  7:06 ` Per Sandberg [this message]
2011-02-16  8:52   ` Dmitry A. Kazakov
2011-02-16 10:51     ` Georg Bauhaus
2011-02-16 13:03       ` Dmitry A. Kazakov
2011-02-16 13:14       ` Rego
replies disabled

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