comp.lang.ada
 help / color / mirror / Atom feed
From: "Beard, Frank" <beardf@spawar.navy.mil>
To: "'comp.lang.ada@ada.eu.org'" <comp.lang.ada@ada.eu.org>
Cc: "'chris.danx@ntlworld.com'" <chris.danx@ntlworld.com>
Subject: RE: Converting Mod types to Character types...
Date: Mon, 14 May 2001 19:34:42 -0400
Date: 2001-05-14T19:34:42-04:00	[thread overview]
Message-ID: <mailman.989883373.1404.comp.lang.ada@ada.eu.org> (raw)

Actually, since modular types fall into the universal integer
category, the conversion is even easier:

  char : character := ' ';
  uc   : Interfaces.C.unsigned_char := 65;
  
begin

  char := character'val(uc);  -- char is now 'A'

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




             reply	other threads:[~2001-05-14 23:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-14 23:34 Beard, Frank [this message]
2001-05-15  8:47 ` Converting Mod types to Character types chris.danx
  -- strict thread matches above, loose matches on Subject: below --
2001-05-14 23:30 Beard, Frank
2001-05-14 22:49 chris.danx
replies disabled

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