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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8b843668b02b23b5,start X-Google-Attributes: gid103376,public From: Andy Askey Subject: Constructors in Ada95 Date: 2000/02/21 Message-ID: #1/1 X-Deja-AN: 588236429 Content-Transfer-Encoding: 7bit Organization: MindSpring Enterprises X-Server-Date: 22 Feb 2000 03:44:20 GMT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-02-22T03:44:20+00:00 List-Id: Hello, I am sure this has been asked/answered several hundred times but nothing current appears in DejaNews. I want to call a procedure each time an object is instantiated for a specific class/type and pass the current instance into the procedures. (I could call the procedure after the object is instantiated, but it will be easier on the user of my class/type if the procedure is automatically called after instantiation.) I looked into using a Controlled type, but I still cannot figure out how to work on a specific object instance's data. For example (possible syntax errors included)... package pkg is type type1 is tagged private; private type type1 is tagged record i : integer := 0; end record; end pkg; package body pkg is ... begin Proc_To_Call( This_Current_Instance : in Type1'class); end pkg; Any tips will be useful as I cannot find any info about this in any of my Ada books. I have "Ada(95) as a Second Language", so if you know of a section that discusses C++ style constructors, please help me out with the page numbers. Also, any info on the web that deals with this would be helpful. I do not mind reading, but I don't have a lot of time to figure out what it is I should read to answer my immediate question. Thanx. -- ---------------------------------------------------- | Andy Askey | | Software Engineer | | Raytheon Electronic Systems | | 353 James Record Road, Huntsville, AL 35824 | | Phone: (256) 772-4846 Fax: (256) 772-4771 | | andrew_j_askey@res.raytheon.com | ---------------------------------------------------- -- Andy Askey ajaskey@mindspring.com