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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b7e91a32073f0674 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-23 14:35:23 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: whats semicolon? Date: 23 Oct 2003 22:33:13 +0100 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: <3F983E65.2080407@terra.es> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1066944922 1618 62.49.19.209 (23 Oct 2003 21:35:22 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Thu, 23 Oct 2003 21:35:22 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:1546 Date: 2003-10-23T22:33:13+01:00 List-Id: "@{-_-}@" writes: > Im triying to develop a code in ADA. Im a newbie :). This code must > ouput a series number. > > If I try a number N lagger than nought the program must ouput a > progressive series number from 1 as far as N. > > If I try a number N smaller than nought, the program must output a > progressive series number from -1 as far as N. > > If I try nouth the program must output "ZERO". > > I tried the following intructions: > > with Text_Io, Ada.Integer_Text_IO; > use Text_Io, Ada.Integer_Text_IO; > > procedure Practica1 is > > n: integer; > c: integer :=0; > > 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 > put (c); > end loop > end if > > end if > > end Practica1; > > When I try to compile it, the objectada show the following error: > > practica1.adb: Error: line 20 col 2 Parse error: expected SEMICOLON, > got ELSE, Inserting SEMICOLON > > Whats SEMICOLON? ; In Ada, the semicolon is a terminator not a separator. if n = 0 then put ("cero"); else (can you see that this fails to meet your requirements as stated in at least two respects?) Same semicolon problem later on at end loop; end if; . -- Simon Wright 100% Ada, no bugs.