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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news-in.ntli.net!newsrout1-win.ntli.net!ntli.net!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: expect procedure name in procedure call(newbie) Date: Wed, 29 Dec 2004 19:46:49 +0100 Organization: None Message-ID: <55225700.btkFaDockb@linux1.krischik.com> References: <1104316623.493536.111460@f14g2000cwb.googlegroups.com> Reply-To: martin@krischik.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1104346730 04 2478 A6asrkaOsvy6di5 041229 18:58:50 X-Complaints-To: usenet-abuse@t-online.de X-ID: Z6BPW0ZSQeBVZnW5dn-JE-ZxCHd2bCqNkTnnSj1OUpqdF+HO6e9OsW User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:7305 Date: 2004-12-29T19:46:49+01: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? If you learn for Hobby then I suggest a container lib with support for indefinite object: http://en.wikibooks.org/wiki/Programming:Ada:Libraries:MultiPurpose:AdaCL#Components. If not you have to do it the hard way: http://en.wikibooks.org/wiki/Programming:Ada:Types:access > thanks in advance > best regards R > > Codes: > > main.adb: > -------- > with testclass; > procedure Main is > object : testclass.rec1_Access; > begin > testclass.Create(object, 10); > end Main; > > testclass.ads: > -------------- > package testclass is > type rec1 is tagged private; > type rec1_Access is access rec1; > function Create(this: rec1_Access; s: Integer) return Integer; You call the parameter this - but Create is a "static" method. Read: http://en.wikibooks.org/wiki/Programming:Ada:OO#Primitive_operations > private > type rec1 is tagged record > field: Integer; > end record; > end testclass; > > testclass.adb: > -------------- > package body testclass is > function Create(this: rec1_Access; s: Integer) return Integer is > begin > this.field :=s; your are aware that this is null? > return this.field; > end Create; > end testclass; -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com