From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ff016264a967a8e0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-20 05:29:52 PST Path: pad-thai.cam.ov.com!noc.near.net!yale.edu!yale!zip.eecs.umich.edu!newshost.marcam.com!news.mathworks.com!udel!gatech!swiss.ans.net!butch!cliffy.lfwc.lockheed.com!cliffy.lfwc.lockheed.com!l107353 From: l107353@cliffy.lfwc.lockheed.com (Garlington KE) Newsgroups: comp.lang.ada Subject: Re: Access type conversion... Date: 20 Jan 1995 00:12:00 GMT Organization: Lockheed Fort Worth Company Message-ID: <3fmv4g$4mq@cliffy.lfwc.lockheed.com> References: NNTP-Posting-Host: 134.189.143.19 X-Newsreader: TIN [version 1.2 PL2] Date: 1995-01-20T00:12:00+00:00 List-Id: 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.