comp.lang.ada
 help / color / mirror / Atom feed
From: "ramesh" <ramesh.mudedla@gmail.com>
Subject: Re: need help with errors im getting
Date: 26 Jun 2005 01:12:22 -0700
Date: 2005-06-26T01:12:22-07:00	[thread overview]
Message-ID: <1119773542.691728.137240@g49g2000cwa.googlegroups.com> (raw)
In-Reply-To: <6g5sb1ptj1611oq6vbiirutlj9gv5lv39m@4ax.com>

Thanks Dennis for you time and valuable sujjestions.

I have changed my code now but having error in one of the procedures to
get Employee Hired date.
-------------------------------------------------------------
Testing.Ads
-------------------------------------------------------------
with Date_pack; use Date_pack;

package testing is


type sex1 is (male, female);
subtype String20 is String(1..20);

type person is abstract tagged limited private;
procedure PersonDetails(p: in out Person ; name1: String20; dob: Date;
s: sex1);
procedure printName(person_name: Person);

type Employee is abstract tagged limited private;
procedure EmployeeDetails(e: in out Employee; name2: String20;
dob:Date; s: sex1);
procedure printDateHired(dh: Employee);

private
Year, Day : INTEGER;
MOnth : Month_name;

type person is abstract tagged limited

record
Name : String20;
BirthDate : Date := (January,1,1970);
Sex : Sex1;
end record;
---------------------------------------------------------------
Testing.Adb
--------------------------------------------------------------
with Ada.Text_IO; use Ada.Text_IO;
with Date_pack; use Date_pack;
--with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;

--with testing; use testing;

package body testing is

procedure PersonDetails( p: in out Person;name1: String20; dob: Date;
s: sex1) is

begin
p.name := name1;
p.sex := s;
p.BirthDate:= dob;
end;

procedure printName(person_name: Person) is

begin
for i in 1..String20'Last loop
put(Person_name.name(i));
end loop;
end;

procedure EmployeeDetails(e: in out Employee; name2: String20;
dob:Date; s: sex1) is
begin
e.name := name2;
e.sex := s;
e.BirthDate := dob;
end;

procedure printDateHired(dh : Employee) is
begin
put(dh.DateHired);----- Getting error here"invalid parameter list in
call"
--put(dh);
--Put(Month,10);Put("/"); Put(Day,3);Put("/"); Put(Year,5);

end;

end testing;
------------------------------------------------------------
Error: "Invalid Parameter list in call" --marked as seen above  for
line
--------------------------------------------------------------------


If you wanna look at Date_pack

Date_pack.Ads
---------------------------------------------

package Date_pack is

type Month_name is (January, February, March, April, May, June, July,
August, September, October, November, December);
--subtype month_name is integer range 1..12;--to change it into
Jan,feb,mar,... refer page 51 of AdaTagged1.doc
subtype day_range is integer range 1..31;
subtype year_range is integer range 1800..2050;

type Date is

record
month: month_name;
day: day_range;--Integer range 1..31;
year: year_range;--Integer range 1800..2050;
end record;

procedure CreateADate;
procedure CreateADate(d: in out Date; mm : month_name; dd : day_range;
yy : year_range);
procedure SetDate(d: in out Date; mm : month_name; dd : day_range; yy :
year_range);
Procedure GetDate(d: in out Date);
procedure GetMonth(d: in out Date);
procedure GetDay(d: in out Date);
procedure GetYear(d: in out Date);

end Date_pack;

---------------------------------------------------------------
Im still working on Student package as i wanted to do using tasks,
Please help with it.
--------------------------------------------------------




  parent reply	other threads:[~2005-06-26  8:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-24 21:59 need help with errors im getting ramesh
2005-06-24 22:42 ` Ed Falis
2005-06-25  1:43   ` ramesh
2005-06-25  6:17 ` Jeffrey Carter
2005-06-25 18:38   ` ramesh
     [not found]     ` <fovrb1t2l3nvsq6qden8vf2fkmgvg3614h@4ax.com>
     [not found]       ` <6g5sb1ptj1611oq6vbiirutlj9gv5lv39m@4ax.com>
2005-06-26  8:12         ` ramesh [this message]
2005-06-26  9:23           ` ramesh
     [not found]           ` <fu9ub1la6ofoc361j6pec48je2efh0b9e9@4ax.com>
     [not found]             ` <l3eub1l2ru5pguun3kitesfmgnfngur7vp@4ax.com>
2005-07-02  8:14               ` ramesh
2005-07-04  5:38               ` Dave Thompson
2005-07-04 21:16                 ` ramesh
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox