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-Thread: 103376,d0fa2610a6bea4ec,start X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!t-online.de!news.nask.pl!news.nask.org.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail From: Mateusz Papiernik Newsgroups: comp.lang.ada Subject: Nested declares, constant size arrays and clarity Date: Thu, 04 Oct 2007 00:58:14 +0200 Organization: tp.internet - http://www.tpi.pl/ Message-ID: NNTP-Posting-Host: acpj86.neoplus.adsl.tpnet.pl Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Trace: nemesis.news.tpi.pl 1191452616 19361 83.10.215.86 (3 Oct 2007 23:03:36 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Wed, 3 Oct 2007 23:03:36 +0000 (UTC) User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) Xref: g2news2.google.com comp.lang.ada:2283 Date: 2007-10-04T00:58:14+02:00 List-Id: Hey! I'm starting off with Ada95. I'm having some problems with clarity of my solution, which - I think - is not as good as I would like to. I've got my root procedure in which I read some number from the standard input. Then I create an array of MyType with size read before. procedure mxp is ... -- some record type declarations ... -- some *functions* begin ... -- read size declare type MyTypeArray is array (1...sizegiven) of MyType; MyArray: MyTypeArray; ... -- some *functions* doing something with newly made array begin ... -- these function calls end; end; The problem is, I don't really like the idea of declaring some functions in the root procedure declaration, and some others in nested declare section. Due to that I've got function implementations in two places, which somehow feels awkward to me. Is there any way to accomplish the same without that nesting _and_ without building external module/using OOP/pointers? Maybe there is a way to define general array type of unknown size, then declare functions doing something with it in the topmost declaration section, and then only somehow initialise the array with given size? Thanks for any advice! -- Mateusz Papiernik, Maticomp Webdesign Projektowanie i realizacja witryn WWW mati@maticomp.net, http://www.maticomp.net "One man can make a difference" - Wilton Knight