You are not logged in.
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
I'm not a programmer in Ada, but are you sure is integer_IO and no Integer_IO?
Offline
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.
Offline
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.
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
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
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
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.
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
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
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