comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@acm.org>
To: frankgerlach@gmail.com (Frank Gerlach)
Cc: comp.lang.ada@ada-france.org
Subject: Re: Trouble with Ada.Streams.Stream_Element
Date: Tue, 19 Apr 2005 20:05:04 -0400
Date: 2005-04-19T20:05:04-04:00	[thread overview]
Message-ID: <mailman.58.1113955528.24457.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <d18a5f0d.0504191527.72f0fe31@posting.google.com> (Frank Gerlach's message of "19 Apr 2005 16:27:53 -0700")

frankgerlach@gmail.com (Frank Gerlach) writes:

> It is defined as follows:
> type Stream_Element is mod 2 ** Standard'Storage_Unit;
> I would like to convert it to an INTEGER.
> How do I do this ?

Stream_Element is already a perfectly good numeric type; why do you
want to convert it to another numeric type? 

If it's because you want to write it to a text file, instantiating
Ada.Text_IO.Modular_IO is better.

But if you insist, this is just a numeric type conversion: 

A : Stream_Element := 2;
B : Integer := Integer (A);

-- 
-- Stephe




  parent reply	other threads:[~2005-04-20  0:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-19 23:27 Trouble with Ada.Streams.Stream_Element Frank Gerlach
2005-04-19 23:46 ` Eric Jacoboni
2005-04-20  0:05 ` Stephen Leake [this message]
2005-04-20  1:21 ` Georg Bauhaus
replies disabled

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