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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!newsfeed1.swip.net!news.astraweb.com!border6.a.newsrouter.astraweb.com!cyclone03.ams2.highwinds-media.com!news.highwinds-media.com!voer-me.highwinds-media.com!post02.fr7!fx03.fr7.POSTED!not-for-mail From: Brian Drummond Subject: Re: need help learning Ada for a modula-2 programmer Newsgroups: comp.lang.ada References: <2fnte9ho690kn2vqr2m926rjsvg9asr76s@4ax.com> User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID: NNTP-Posting-Host: 62.49.20.82 X-Complaints-To: abuse@demon.net X-Trace: 1391432022 62.49.20.82 (Mon, 03 Feb 2014 12:53:42 UTC) NNTP-Posting-Date: Mon, 03 Feb 2014 12:53:42 UTC Date: Mon, 03 Feb 2014 12:53:42 GMT X-Received-Body-CRC: 2077170999 X-Received-Bytes: 1563 Xref: news.eternal-september.org comp.lang.ada:18359 Date: 2014-02-03T12:53:42+00:00 List-Id: On Sun, 02 Feb 2014 19:10:16 -0500, agent wrote: > On Sun, 02 Feb 2014 17:18:44 GMT, Brian Drummond > wrote: >>function GetCommandLine return String is >> length : natural := 0; >>BEGIN >> for i in 1 to argument_count loop >> length := length + argument(i)'length; >> end loop; > No matter what I try, I'm getting a constraint error. I don't > understand what's wrong. > > The compiler noticed that FOR i in 1 to argument_count is wrong. > That's modula-2 syntax. It's also VHDL syntax : VHDL and Ada are quite similar, and I keep switching between them, which is why I got it wrong! - Brian