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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9554fa8e8644e566 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-14 16:32:15 PST Path: archiver1.sj.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!193.251.151.101!opentransit.net!jussieu.fr!enst!enst.fr!not-for-mail From: "Beard, Frank" Newsgroups: comp.lang.ada Subject: RE: Converting Mod types to Character types... Date: Mon, 14 May 2001 19:30:44 -0400 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: avanie.enst.fr 989883133 86889 137.194.161.2 (14 May 2001 23:32:13 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Mon, 14 May 2001 23:32:13 +0000 (UTC) Cc: "'chris.danx@ntlworld.com'" To: "'comp.lang.ada@ada.eu.org'" Return-Path: X-Mailer: Internet Mail Service (5.5.2448.0) Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.3 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.sj.google.com comp.lang.ada:7503 Date: 2001-05-14T19:30:44-04:00 Since Interfaces.C does not supply a "To_Ada" function for unsigned_char as it does for the other character types, and you presumably aren't supposed to assume a correlation between Interfaces.C.char and Interfaces.C.unsigned_char, then you will have to convert it yourself. This is assuming you're asking how to convert between Interfaces.C.unsigned_char and character, then the simplest way is probably: char : character := ' '; uc : Interfaces.C.unsigned_char := 65; begin char := character'val(integer(uc)); -- char is now 'A' Is this what you were asking? Frank -----Original Message----- From: chris.danx [mailto:chris.danx@ntlworld.com] Sent: Monday, May 14, 2001 6:50 PM To: comp.lang.ada@ada.eu.org Subject: Converting Mod types to Character types... Hi, I've got my interface to Vx thing working but i want to display the contents of the information it retrieves. I've got Interfaces.C.Unsigned_Char types in an array and this maps to a Mod type in GNAT. I've tried allsorts of conversions between a single C.UC to character and unsigned conversions too. How do i convert between them? It's annoying since this is the only thing that's not working, everything else is. Thanks, Chris Campbell _______________________________________________ comp.lang.ada mailing list comp.lang.ada@ada.eu.org http://ada.eu.org/mailman/listinfo/comp.lang.ada