comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: loop variable
Date: Mon, 29 Sep 2008 07:54:22 -0700 (PDT)
Date: 2008-09-29T07:54:22-07:00	[thread overview]
Message-ID: <8736077d-94e0-4a53-9d0a-2999a421a8e3@l33g2000pri.googlegroups.com> (raw)
In-Reply-To: f1b15f7e-26a1-4f61-80a0-6f9ce1cfe251@m36g2000hse.googlegroups.com

On Sep 28, 6:54 pm, jedivaughn <jedivaugh...@gmail.com> wrote:
> What data_type is a loop variable
> as an example
> for i in 1..10
> what data type is i?
> and can I convert it to an integer?

If either of the expressions in the range had a particular type, "I"
would be of that type.  E.g.

   for I in 1..X

where X is declared with some user-defined integer type, then "I"
would have the same type as X.  The above case, where the range is
made up of two universal integers, is special, and the language
defines the type to be Standard.Integer in that case.  You can also
say something like

   for I in My_Int_Type range 1..10

and then "I" would have the type My_Int_Type.

                                -- Adam






      parent reply	other threads:[~2008-09-29 14:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-29  1:54 loop variable jedivaughn
2008-09-29  3:20 ` george.priv
2008-09-29  8:52   ` Georg Bauhaus
2008-09-29 10:38 ` Peter C. Chapin
2008-09-30  7:52   ` Jean-Pierre Rosen
2008-09-29 14:54 ` Adam Beneschan [this message]
replies disabled

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