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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ef0a2057d81387f4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Generic,procedure and visibility. Date: 25 Nov 2004 14:15:08 -0500 Organization: Cuivre, Argent, Or Message-ID: References: <1101400573.954385.108150@f14g2000cwb.googlegroups.com> <1101401637.028058.169190@z14g2000cwz.googlegroups.com> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1101410151 94526 212.85.156.195 (25 Nov 2004 19:15:51 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Thu, 25 Nov 2004 19:15:51 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: <1101401637.028058.169190@z14g2000cwz.googlegroups.com> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:6476 Date: 2004-11-25T14:15:08-05:00 "mferracini" writes: > now see this new case: > > package Generico is > generic > with procedure Lavora; > package Nascosto is > procedure Inizia; > end Nascosto; > end Generico; Please use standard indentation; it makes things much easier to read: package Generico is generic with procedure Lavora; package Nascosto is procedure Inizia; end Nascosto; end Generico; package body Generico is package body Nascosto is task type Pippo is entry Fai; end Pippo; task body Pippo is begin accept Fai; Lavora; end Pippo; type P_Pippo is access Pippo; x:p_pippo; procedure Inizia is begin X:=new Pippo; X.Fai; end Inizia; end Nascosto; begin null; end Generico; Note that you _don't_ need the "begin null;" at the end of the package; that is optional, and should only be there if it does some initialization. > evry time that call i [thing that is a new generico.nascosto].inizia > a new task born. Yes; X := new Pippo; creates a new task. > so i want to create a array of this task for manage them. > how i can do? type Task_Array is array (1 .. 10) of P_Pippo; Have Inizia return the pointer it creates, so the user can store it in the array. -- -- Stephe