From: John B. Matthews on
In article <nospam-84056C.10444823042010(a)news.aioe.org>,
"John B. Matthews" <nospam(a)nospam.invalid> wrote:

> In article
> <e98bcf01-46cc-44dd-b57b-3cc7e273d9e2(a)j21g2000yqh.googlegroups.com>,
> resander <kresander(a)gmail.com> wrote:
>
> > Prodrecord address: -1079352648
> > code field address: -1079352648
> > bcode field address: -1079352644
> > ccode field address: -1079352643
> > third field address: -1079352640
> > descr field address: -1079352636
> > price field address: -1079352624
> > ...
> > Q1.
> > Addresses are not negative. How do I output a System.Address?
>
> -1079352648 = 0xBFAA62B8
> -1079352644 = 0xBFAA62BC
> ...
>
> This recent thread discusses several ways to display hexadecimal:
>
> <http://groups.google.com/group/comp.lang.ada/browse_frm/thread/f3514db0a21f9b
> 44>
>
> A.10.8 Input-Output for Integer Types may be the most straightforward:
>
> <http://www.adaic.com/standards/05rm/html/RM-A-10-8.html>

For example,

with Ada.Text_IO;
with System.Storage_Elements;

procedure Modular is

package Memory renames System.Storage_Elements;
package Address_IO is
new Ada.Text_IO.Modular_IO(Memory.Integer_Address);

begin
Ada.Text_IO.Put("Address of procedure Modular: ");
Address_IO.Put(
Item => Memory.To_Integer(Modular'Address),
Width => 0,
Base => 16);
Ada.Text_IO.New_Line;
end Modular;

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>