You are not logged in.

#1 2010-02-28 20:22:37

SpeedVin
Member
From: Poland
Registered: 2009-04-29
Posts: 955

[Solve]Compile Ada code with integer_IO ,error integer.ads not found.

Hello all again.
I do some programming in Ada and i am very fascinated this language.
I got problem when using integer_IO in my code.
When it compiling I got strange error integer.ads not found.
BTW.My compiler is GNAT 4.4.1.
Thanks for help.

Last edited by SpeedVin (2010-03-01 17:30:56)


Shell Scripter | C/C++/Python/Java Coder | ZSH

Offline

#2 2010-02-28 20:38:08

n0dix
Member
Registered: 2009-09-22
Posts: 956

Re: [Solve]Compile Ada code with integer_IO ,error integer.ads not found.

I'm not a programmer in Ada, but are you sure is  integer_IO and no  Integer_IO?

Offline

#3 2010-03-01 15:19:32

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [Solve]Compile Ada code with integer_IO ,error integer.ads not found.

I also think Ada is fascinating. I wrote a small video game in Ada and I use Ada a little at work.

"integer_IO" and "Integer_IO" doesn't matter, because Ada is case insensitive.

I'm not home right now, but I think "Integer_IO" is a subpackage of "Text_IO":

with Ada.Text_IO.Integer_IO;

If you want, you can post your code and I'll see if I can compile it.

Are you an Ada beginner? Even though I have been working with Ada for more than a year now, I still don't think I'm very good at it. I wish there was more documentation and more projects used Ada. hmm

Offline

#4 2010-03-01 15:32:27

SpeedVin
Member
From: Poland
Registered: 2009-04-29
Posts: 955

Re: [Solve]Compile Ada code with integer_IO ,error integer.ads not found.

drcouzelis wrote:

I also think Ada is fascinating. I wrote a small video game in Ada and I use Ada a little at work.

"integer_IO" and "Integer_IO" doesn't matter, because Ada is case insensitive.

I'm not home right now, but I think "Integer_IO" is a subpackage of "Text_IO":

with Ada.Text_IO.Integer_IO;

If you want, you can post your code and I'll see if I can compile it.

Are you an Ada beginner? Even though I have been working with Ada for more than a year now, I still don't think I'm very good at it. I wish there was more documentation and more projects used Ada. hmm

Yes I'm new  into this language.
I really won to that there will be more project's/program's written in ADA.
This is my program code:

With Text_IO;
Use Text_IO;
With Ada.Text_IO.Integer_IO;

procedure file is

              Age :integer range 0..100;
begin
if Age < 18 then
           put_line("BABY!!!");
else
           put_line("OLD MAN!!!");
end if;
end;

When I try to compile it I get error:

file.adb:3:17: "Integer_IO" is a nested package, not a compilation unit

Shell Scripter | C/C++/Python/Java Coder | ZSH

Offline

#5 2010-03-01 15:56:48

urist
Member
Registered: 2009-02-22
Posts: 248

Re: [Solve]Compile Ada code with integer_IO ,error integer.ads not found.

While some things are case-insensitive, declarations aren't included. Integer_IO is not the same as integer_IO.

The Ada95 specification, which is what I was taught, uses Ada.Integer_Text_IO. I'm assuming Integer_IO is the 2005 spec.

Last edited by urist (2010-03-01 16:00:46)

Offline

#6 2010-03-01 15:57:20

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [Solve]Compile Ada code with integer_IO ,error integer.ads not found.

I found this information: http://coding.derkeiler.com/Archive/Ada … /0097.html

This compiles for me, but I can't run it right now:

with Ada.Text_IO;
use Ada.Text_IO;

procedure Age is

  package IntIO is new Integer_IO(Integer);

  An_Age : Integer range 0..100 := 30; -- Default value is 30

begin

  IntIO.Get(An_Age); -- Read an age from the command line (I think...)

  if An_Age < 18 then
    Put_Line("Baby!!");
  else
    Put_Line("Old man!!");
  end if;

end Age;

What do you want to use in "Integer_IO"?

By the way, is this a school project?

Last edited by drcouzelis (2010-03-01 15:57:47)

Offline

#7 2010-03-01 16:01:10

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [Solve]Compile Ada code with integer_IO ,error integer.ads not found.

urist wrote:

While some things are case-insensitive, declarations aren't included. Integer_IO is not the same as integer_IO.

No, declarations are case insensitive. They are the same.

For example

with Ada.Text_IO;
use Ada.Text_IO;

and

with aDa.TeXt_Io;
use AdA.tExT_iO;

compiles the same.

urist wrote:

The Ada95 specification, which is what I was taught, uses Ada.Integer_Text_IO. I'm assuming Integer_IO is the 2005 spec.

I see! "Integer_Text_IO" is an instantiation of "Integer_IO" using "Integer": http://en.wikibooks.org/wiki/Ada_Progra … er_Text_IO

Last edited by drcouzelis (2010-03-01 16:05:51)

Offline

#8 2010-03-01 16:11:31

urist
Member
Registered: 2009-02-22
Posts: 248

Re: [Solve]Compile Ada code with integer_IO ,error integer.ads not found.

drcouzelis wrote:
urist wrote:

While some things are case-insensitive, declarations aren't included. Integer_IO is not the same as integer_IO.

No, declarations are case insensitive. They are the same.

For example

with Ada.Text_IO;
use Ada.Text_IO;

and

with aDa.TeXt_Io;
use AdA.tExT_iO;

compiles the same.

Hrm... I just tried this a few days ago but it's not working now. I've been out of Ada for too long. I can't remember anything. These are the evils of being taught from the old spec when there's a new one around.

I thought I remembered having an error with lowercase declarations. Maybe not.

Last edited by urist (2010-03-01 16:15:38)

Offline

#9 2010-03-01 16:31:29

SpeedVin
Member
From: Poland
Registered: 2009-04-29
Posts: 955

Re: [Solve]Compile Ada code with integer_IO ,error integer.ads not found.

drcouzelis wrote:

I found this information: http://coding.derkeiler.com/Archive/Ada … /0097.html

This compiles for me, but I can't run it right now:

with Ada.Text_IO;
use Ada.Text_IO;

procedure Age is

  package IntIO is new Integer_IO(Integer);

  An_Age : Integer range 0..100 := 30; -- Default value is 30

begin

  IntIO.Get(An_Age); -- Read an age from the command line (I think...)

  if An_Age < 18 then
    Put_Line("Baby!!");
  else
    Put_Line("Old man!!");
  end if;

end Age;

What do you want to use in "Integer_IO"?

By the way, is this a school project?

About this school project.
No it isn't programming is my hobby and I do this all by teaching myself.
Ok It's working fine thanks.


Shell Scripter | C/C++/Python/Java Coder | ZSH

Offline

Board footer

Powered by FluxBB