From: Ludovic Brenta <ludovic.brenta@insalien.org>
Subject: Re: whats semicolon?
Date: 24 Oct 2003 01:32:30 +0200
Date: 2003-10-24T01:32:30+02:00 [thread overview]
Message-ID: <m3u15z4jjl.fsf@insalien.org> (raw)
In-Reply-To: 3F983E65.2080407@terra.es
"@{-_-}@" <nuhvok@terra.es> writes:
> with Text_Io, Ada.Integer_Text_IO;
> use Text_Io, Ada.Integer_Text_IO;
^^^^^^^
This package is obsolete. It is recommended to use Ada.Text_IO
instead. But this will not harm your program until the next revision
of Ada.
> procedure Practica1 is
>
> n: integer;
> c: integer :=0;
^^^^^^^^^^^^^^^^
You do not need to declare this variable. The "for" loops below will
declare it implicitly for you.
> begin
> put ("Escribe un numero entero: ");
> get (n);
> if n = 0 then
> put("cero")
> else
> IF N > 0 then
> for c in 0..n loop
> put (c);
> end loop
> else
> for c in -1..n loop
^^^^^^^^
This loop will be executed zero or one times, depending on n. Do you
understand why? Is this whant you want?
> put (c);
> end loop
> end if
> end if
> end Practica1;
Regarding the semicolons, Simon Wright answered already. It looks
like you come from Pascal :)
HTH
--
Ludovic Brenta.
next prev parent reply other threads:[~2003-10-23 23:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-23 20:47 whats semicolon? @{-_-}@
2003-10-23 21:33 ` Simon Wright
2003-10-23 23:32 ` Ludovic Brenta [this message]
2003-10-23 23:56 ` Martin Dowie
2003-10-24 1:19 ` Jeffrey Carter
2003-10-24 13:28 ` Preben Randhol
2003-10-24 14:34 ` Martin Dowie
2003-10-24 15:10 ` Preben Randhol
2003-10-24 17:20 ` Martin Dowie
[not found] ` <n2mm61-fg3.ln1@beastie.ix.netcom.com>
2003-10-24 20:06 ` Simon Wright
2003-10-25 13:39 ` Roberto Waltman
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox