comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: How to print Task_ID type? (GNAT SunOS)
Date: 1996/04/05
Date: 1996-04-05T00:00:00+00:00	[thread overview]
Message-ID: <dewar.828705742@schonberg> (raw)
In-Reply-To: 31642F61.1D2B@ee.ubc.ca

Greg asked

"Indeed it is. My oversight. This function does not handle the more
general problem I posed though. Is there a general facility for printing
access types? The GNAT implementation of the Image function above is a
system level (i.e. platform dependent) routine specifically for the
Task_ID type. The only Ada references I've got are Barnes for Ada 95 and
the ALRM, both of which are woefully inadequate on the topic of Ada I/O."

You really must get annex A of the RM, it's quite easy to read (much
easier than the rest of the RM), and is full of useful stuff. You can
pull it off the net, see Ada FAQ for details.

The easiest way to do what you want is:

Integer_Address'Image (To_Integer (Pointer.all'Address))

this is from system.storage_elements

If you want to output the address in hex, then still use
To_Integer(Pointer.all'Addess)
but output the integer value using Text_IO.Modular_IO.Put with
an appropriate base parameter.





  parent reply	other threads:[~1996-04-05  0:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-03  0:00 How to print Task_ID type? (GNAT SunOS) Greg Bond
1996-04-04  0:00 ` Robert Dewar
1996-04-04  0:00   ` Greg Bond
1996-04-05  0:00     ` Keith Thompson
1996-04-05  0:00       ` Greg Bond
1996-04-05  0:00       ` Robert Dewar
1996-04-06  0:00         ` Keith Thompson
1996-04-06  0:00           ` Robert Dewar
1996-04-07  0:00           ` Keith Thompson
1996-04-05  0:00     ` Robert Dewar [this message]
1996-04-04  0:00   ` Greg Bond
1996-04-05  0:00   ` Laurent Guerby
1996-04-04  0:00     ` Joel Sherrill
1996-04-06  0:00       ` Fergus Henderson
1996-04-06  0:00         ` Robert Dewar
replies disabled

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