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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,51e0e3232c45c76c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-11 08:59:26 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!howland.erols.net!news-out.worldnet.att.net.MISMATCH!wn3feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc06-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3B24EB7A.D2792E53@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: converting - adasockets References: <20010611.085009.1789366143.627@zamek.gda.pl> <3b2498c9$1_2@Newsfeeds.com> <3B24AF5D.241C9743@Physik.Uni-Magdeburg.DE> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Mon, 11 Jun 2001 15:59:26 GMT NNTP-Posting-Host: 12.86.34.232 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc06-news.ops.worldnet.att.net 992275166 12.86.34.232 (Mon, 11 Jun 2001 15:59:26 GMT) NNTP-Posting-Date: Mon, 11 Jun 2001 15:59:26 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:8553 Date: 2001-06-11T15:59:26+00:00 List-Id: Gerald Kasner wrote: > > "David C. Hoos, Sr." schrieb: > > > > Assuming the following Ada declarations, > > S : String [1 .. 10]; > > This is not an Ada declaration ! (Pascal,Modula-2,Oberon-2...??) > > > I : Integer; > > > Why unchecked conversion ? Unchecked Conversion is necessary because the data is not a string representation of an integer, but an integer value returned as a string. For instance, if the integer is represented as 32 bits, the string will be returned as a four byte string. Those four bytes need to be interpreted as an integer instead of as a string. Ada provides two approaches for solving this problem. The first is to use unchecked conversion as described by Mr. Hoos. The second is to define a string and an integer to occupy the same address. Simply copy the string from Adasockets into the overlayed string, then read the value as an integer. The C code example used by the original poster showed the C equivalent of viewing a string as an integer. There was no conversion of values as would occur using the 'value attribute. Jim Rogers Colorado Springs, Colorado USA