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.1 required=5.0 tests=AXB_XMAILER_MIMEOLE_OL_024C2, BAYES_00,MAILING_LIST_MULTI,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,728ebc1b09769de6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-17 03:58:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada Subject: Re: Whats wrong with my Callbacks? Date: Fri, 17 May 2002 05:57:48 -0500 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0303_01C1FD67.C5896820" X-Trace: avanie.enst.fr 1021633082 47914 137.194.161.2 (17 May 2002 10:58:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Fri, 17 May 2002 10:58:02 +0000 (UTC) Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.8 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:24262 Date: 2002-05-17T05:57:48-05:00 This is a multi-part message in MIME format. ------=_NextPart_000_0303_01C1FD67.C5896820 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit ----- Original Message ----- From: "Darren" Newsgroups: comp.lang.ada To: Sent: May 17, 2002 4:52 AM Subject: Whats wrong with my Callbacks? > Could anybody tell me why this isnt working? > If you add a delay statement (e.g. delay 10.0;) as the last statement in your main program, the program will continue to run until the delay expires. Without the delay, the main program immediately terminates, causing procedure P to no longer exist; However, in the attachments, I show a better way; > /D > > > ------------------------------------------------------------------------------ -- > > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada > > ------=_NextPart_000_0303_01C1FD67.C5896820 Content-Type: application/octet-stream; name="b.adb" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="b.adb" with A; with Ada.Unchecked_Conversion, Text_Io; procedure B is procedure P is begin Text_Io.put("Hi"); end P; Sim : A.Sim (P'Unrestricted_Access); begin delay 10.0; abort Sim; end B; ------=_NextPart_000_0303_01C1FD67.C5896820 Content-Type: application/octet-stream; name="a.ads" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="a.ads" package A is type Proc_Ptr_Type is access procedure; Global_Ptr : Proc_Ptr_Type; task type sim (Callback : Proc_Ptr_Type) is end sim; end A; ------=_NextPart_000_0303_01C1FD67.C5896820 Content-Type: application/octet-stream; name="a.adb" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="a.adb" with Ada.Text_Io; package body A is task body sim is begin loop Callback.all; end loop; end sim; begin null; end a; ------=_NextPart_000_0303_01C1FD67.C5896820--