comp.lang.ada
 help / color / mirror / Atom feed
From: "John B. Matthews" <nospam@nospam.invalid>
Subject: Re: How to access this package written in C?
Date: Fri, 23 Apr 2010 11:39:23 -0400
Date: 2010-04-23T11:39:23-04:00	[thread overview]
Message-ID: <nospam-C2CF76.11392323042010@news.aioe.org> (raw)
In-Reply-To: nospam-84056C.10444823042010@news.aioe.org

In article <nospam-84056C.10444823042010@news.aioe.org>,
 "John B. Matthews" <nospam@nospam.invalid> wrote:

> In article 
> <e98bcf01-46cc-44dd-b57b-3cc7e273d9e2@j21g2000yqh.googlegroups.com>,
>  resander <kresander@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>



  reply	other threads:[~2010-04-23 15:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-21 16:43 How to access this package written in C? resander
2010-04-21 17:39 ` Dmitry A. Kazakov
2010-04-22 20:12 ` Björn Persson
2010-04-22 21:12 ` Keith Thompson
2010-04-23 12:58   ` resander
2010-04-23 14:15     ` Dmitry A. Kazakov
2010-04-23 14:44     ` John B. Matthews
2010-04-23 15:39       ` John B. Matthews [this message]
2010-04-26 18:16     ` Robert A Duff
2010-04-26 19:57       ` Keith Thompson
2010-04-26 21:20         ` Maciej Sobczak
2010-04-27  6:52           ` Alex R. Mosteo
2010-04-27 22:29             ` Randy Brukardt
2010-05-03  8:12               ` Alex R. Mosteo
2010-04-27  0:20         ` Robert A Duff
2010-04-27  1:01           ` Keith Thompson
2010-04-27 16:07             ` Robert A Duff
2010-04-27 22:29               ` Randy Brukardt
2010-04-27  1:31           ` Randy Brukardt
replies disabled

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