comp.lang.ada
 help / color / mirror / Atom feed
From: l107353@cliffy.lfwc.lockheed.com (Garlington KE)
Subject: Re: Access type conversion...
Date: 20 Jan 1995 00:12:00 GMT
Date: 1995-01-20T00:12:00+00:00	[thread overview]
Message-ID: <3fmv4g$4mq@cliffy.lfwc.lockheed.com> (raw)
In-Reply-To: mbejeranD2Hn5E.q5@netcom.com

Marc J Bejerano (mbejeran@netcom.com) wrote:
: I have a question regarding access types. In my application, I have a data
: type which is a string pointer (Type PString is Access String) and a system
: address pointer (tempAddr : System.Address).

: How do I equate the general purpose System.Address to the PString?

As already mentioned, this is dangerous and compiler-dependent. However,
depending upon how the compiler stores data, _sometimes_ you can do
one of the following: (1) do an unchecked_conversion to load the system.address
into the PString object, or (2) do an unchecked_conversion of system.address,
adjusted by some value to compensate for the dynamic bounds of the string
being stored before the string itself, into the Pstring object.

If the real requirement is to be able to declare access objects that
reference strings, without forcing those strings to be allocated via "new",
then get an Ada95 compiler ASAP that implements the improved access mechanisms.
Life will be much simpler.

: -Marc

: P.S. Thanks for your patience.

--
--------------------------------------------------------------------
Ken Garlington                  GarlingtonKE@lfwc.lockheed.com
F-22 Computer Resources         Lockheed Fort Worth Co.

If LFWC or the F-22 program has any opinions, they aren't telling me.



      parent reply	other threads:[~1995-01-20  0:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mbejeranD2Hn5E.q5@netcom.com>
1995-01-18 18:51 ` Access type conversion R. William Beckwith
1995-01-19  9:21 ` Whitteng
1995-01-20  8:59   ` Keith Thompson
1995-01-20  0:12 ` Garlington KE [this message]
replies disabled

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