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,f8c833a73601bbf9 X-Google-Attributes: gid103376,public From: "bklungle" Subject: Re: New to ADA Date: 1997/11/07 Message-ID: <63uluf$c20@sjx-ixn8.ix.netcom.com>#1/1 X-Deja-AN: 287628187 References: <346261AE.1B1F@erols.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Organization: B & D Associates X-NETCOM-Date: Fri Nov 07 1:10:39 AM PST 1997 Newsgroups: comp.lang.ada Date: 1997-11-07T01:10:39-08:00 List-Id: Dennis; Here is your code modified. It compiles and runs on gnat-3.09 for Linux with gnat.io; use gnat.io; with text_io; procedure get_date is type month_name; type month_name is (Jan, Feb, Mar, Apr, May, Jun, Jly, Aug, Sep, Oct, Nov, Dec); -- Hasn't anyone mentioned enumeration io to you yet?? package eio is new text_io.enumeration_io(month_name); use eio; type date_record; type date_ptr is access all date_record; type date_record is record day: integer range 1..31; month: month_name; -- This is an enumeration year: integer; end record; D,date_rec: date_ptr; -- I took off the .all dereferences. Not needed because only referencing -- discrete member begin put("Please enter the desired date "); date_rec := new date_record; D := date_rec; get(D.day); put("Enter Month "); get(D.month); put("Enter Year "); get(D.year); new_line; put("Date entered is "); put(D.day); put("-"); put(D.month); put("-"); put(D.year); new_line; end get_date; Dennis East wrote in message <346261AE.1B1F@erols.com>... >Need some assistance getting started in ADA >In the following procedure I am getting >"invalid parameter list in call" >just trying to get a 3 character month string, and have made several >changes but seem to get one error followed by another. > >-- Procedure to get the date in the format dd,mmm,yyyy > >with gnat.io; use gnat.io; >procedure get_date is > >type month_name; >type month_name is (Jan, Feb, Mar, Apr, May, Jun, Jly > , Aug, Sep, Oct, Nov, Dec); >mon: month_name; > >type date_record; >type date_ptr is access all date_record; >type date_record is > record > day: integer range 1..31; > month: month_name; > year: integer; > end record; > >D,date_rec: date_ptr; > >begin > put("Please enter the desired date "); > date_rec := new date_record; > D := date_rec; > get(D.all.day); > put("Enter Month "); > get(D.all.month); -- Error occurs here > D.all.month:=mon; > put("Enter Year "); > get(D.all.year); > new_line; > put("Date entered is "); > put(D.all.day); > put("-"); > put("D.all.month"); > put("-"); > put(D.all.year); > new_line; >end get_date; > >It is possible I'm overlooking the obvious, so another solution could be >used also. In final package I will need to input name strings into a >linked list record, so I need something similar that works. > >Thanks for any assistance.. Dennis >