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,3bcd1f427235dca8 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!dedekind.zen.co.uk!zen.net.uk!demorgan.zen.co.uk!194.72.9.35.MISMATCH!news-peer1!btnet-feed3!newreader.ukcore.bt.net!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: Martin Dowie Newsgroups: comp.lang.ada Subject: Re: expect procedure name in procedure call(newbie) Date: Wed, 29 Dec 2004 12:32:09 +0000 (UTC) Organization: BT Openworld Message-ID: References: <1104316623.493536.111460@f14g2000cwb.googlegroups.com> NNTP-Posting-Host: host81-152-56-142.range81-152.btcentralplus.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sparta.btinternet.com 1104323529 8641 81.152.56.142 (29 Dec 2004 12:32:09 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Wed, 29 Dec 2004 12:32:09 +0000 (UTC) In-Reply-To: <1104316623.493536.111460@f14g2000cwb.googlegroups.com> X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0RC1 (Windows/20041201) Xref: g2news1.google.com comp.lang.ada:7286 Date: 2004-12-29T12:32:09+00:00 List-Id: R wrote: > Hello. > > I've got 'expect procedure name in procedure call' warning but > I think my code is good > Inside testclass.adb I have Create function and when I'm trying to call > it from > main.adb unit I receive that error. > > Below are full codes of my Ada units. > > And by the way - how can I dynamically allocate memory for e.g. 10 > elements(array of Floats)? > How can I reallocate them to 20 elements or 4? > How can I free the memory? In Ada you don't need to play around with memory allocation/reallocation/deallocation as much in other lower level languages. If you know in advance the maximum number you are going to have then you could use a discriminated array, e.g. type Number_Of_Floats is range 0 .. 20; -- Never going to be more than 20. type Array_Of_Floats is array (Number_Of_Floats range <>) of Float; type Group_Of_Floats (Length : Number_Of_Floats := 0) is record F : Array_Of_Floats (1 .. Length); end record; My_Floats : Group_Of_Floats; begin ... If you really don't know the number of items you are going to have then use one of the many container libraries available - you wouldn't re-invent the wheel and re-code the STL if you were using C++ would you? Here is a link to a page of such libraries: http://www.adapower.com/index.php?Command=Class&ClassID=AdaLibs&Title=Ada+Libraries Look under "Data Types". Cheers -- Martin