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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9208806da73239cc,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!not-for-mail From: di98mase@hotmail.com (Sebastian) Newsgroups: comp.lang.ada Subject: Pointers in Ada Date: 4 Mar 2005 04:25:58 -0800 Organization: http://groups.google.com Message-ID: <6acda821.0503040425.3b437e6a@posting.google.com> NNTP-Posting-Host: 139.58.232.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1109939159 2652 127.0.0.1 (4 Mar 2005 12:25:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 4 Mar 2005 12:25:59 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:8620 Date: 2005-03-04T04:25:58-08:00 List-Id: Hi I have a question about how to initliaze a message that I want to send. The code below shows my types and all, but my concern is the syntax, how do I write the code that initializes the message so that I can call the Put_Message procedure? -- This is MDP_LLD package.... package Mdp_Lld; type Message_Header is record Word_Count : Byte; Command_Id : Byte; end record; subtype Mdp_Message_Data is Byte(1..500); type A_Mdp_Message is record Header : aliased Message_Header; Data : aliased Mdp_Message_Data; end record; type Driver_Msg_Ptr_Type is access all A_MDP_Message; procedure Put_Message (Msg_Buffer_Ptr : in out Client_Msg_Ptr_Type; ); private type Client_Msg_Ptr_Type is new Driver_Msg_Ptr_Type; end Mdp_Lld; -- this is another file with Mdp_lld; use Mdp_lld; procedure Test_Driver is Output_Msg : Mdp_Lld.A_Mdp_Message; Mdp_Msg_Ptr_Out : MDP_LLD.Client_Msg_Ptr_Type; begin -- Initialize output message Output_Msg.Header.Word_Count := 32; Output_Msg.Header.Command_Id := 4; -- How do I Initialize my message to send? Mdp_Msg_Ptr_Out'access := Output_Msg; --this does not work? Mdp_Msg_Ptr_Out.all := Output_Msg; --this does not work? end;