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,FREEMAIL_FROM,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,704b8962c968e4b,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-30 23:41:28 PST From: "Frank" Newsgroups: comp.lang.ada Subject: new/free of abstract types X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Original-NNTP-Posting-Host: 213.225.111.73 Message-ID: <3e87f119$1@news.wineasy.se> X-Original-Trace: 31 Mar 2003 08:41:13 +0100, 213.225.111.73 X-Complaints-To: abuse@songnetworks.se NNTP-Posting-Host: news.wineasy.se X-Original-NNTP-Posting-Host: news.wineasy.se Date: 31 Mar 2003 08:41:14 +0100 X-Trace: wineasy!newsfeed.wineasy.se!news.sto.telegate.se 1049096474 news.wineasy.se (31 Mar 2003 08:41:14 +0100) X-Complaints-To: abuse@songnetworks.se Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!lnsnews.lns.cornell.edu!newsstand.cit.cornell.edu!ngpeer.news.aol.com!newsfeed1.bredband.com!bredband!fi.sn.net!newsfeed2.fi.sn.net!news-stoc.telia.net!news-stoa.telia.net!telia.net!wineasy!newsfeed.wineasy.se!news.sto.telegate.se!news.wineasy.se!not-for-mail Xref: archiver1.google.com comp.lang.ada:35818 Date: 2003-03-31T08:41:14+01:00 List-Id: Hi! Regarding: GNAT3-15p/Windows XP/Ada95 I have an abstract type, and wish to perform a new/free of objects extended from this type, inside one of the methods/subprograms that has the abstract type as a classwide parameter (in one of the type methods, to say it in Java/C++ language).see eksample below. It seems that I cant to it this way: See example below to see how "The_New_Object" is declared: The_New_Object := new MyType; because the real property of the type is not fully known in the scope. What I wish is to create a new object of the same type as the object "P_Parameter" (see example below). Can it be done - if so, how is the syntax? I havent yet tried to do this with the "Freeing" method, so a tip about that would also be appreciated. Frank eksample: --------------- type Pointer_To_MyType is access all MyType; type A_Type is record The_New_Object : Pointer_To_MyType; end record; Something_Global : A_Type; --------------- procedure Subprogram ( ....... P_Parameter : out MyType'Class) is .... ... begin ..... .... Someething_Global.The_New_Object := new MyType; <---------------??????