ada

Cancel space after Integer'Image value in Ada

Hello, when I'm print this procedure below - procedure put (Date:Date_Type) is begin Put(Integer'Image(Date.Day)); --' Put("-"); Put(Integer'Image(Date.Month)); --' Put("-"); Put(Integer'Image(Date.Year)); --' end; The result is (for example) : 1- 1- 2010 My question is how to prevent the spacing of one character before ...

Ada/Eclipse Integration

Are there any freely available Ada plugins eclipse. Eclipse is my main IDE and I occasionally need to read and modify some Ada, having it all in the one IDE would be ideal. ...

how to print date of calendar

I'm using Gnat (old compiler of ada95) and I'm having problem to print the date. I declaired : (with Ada.calendar) Cdate: Calendar.Time; Cdate:= Calendar.Time_Of(Year => 2010,Month => 1,Day => 10); Now I've tried to print it - Put_Line("Year : " & Year(Cdate)'Img); But I didnt managed to do so... ...

Threads and semaphores in Ada95

How can I use threads in Ada95? What functions can I use to create, destroy, stop and start them? How can I use semaphores in this language? ...

Ada compilers for Linux

I'm doing a trade study for Ada development on Linux. Do you have any good compiler/OS recommendations? So far, I've got GNAT from AdaCore running on CentOS 5.4, and I have license requests in for Rational Apex and Aonix ObjectAda. This is a porting effort. The original codebase is Apex 3.0 on OSF1 4.0d. Anything else I should be cons...

ada95 have 3 files .ali, .adb and .o - can I compile

Hi, I've found some old college work, with my final Ada95 project on it. Sadly, the disc was corrupted, and I have only managed to recover 3 files (the source and executable couldnt be recovered): project.adb, project.ali and project.o Are these 3 files enough to compile a new exe? I'm downloading the gnat compiler now, but have to ...

How do you code to determine the logarithm of a value in Ada?

Using Ada (GNAT): I need to determine the power of ten for a given value. The most obvious approach is to use a logarithm; but that fails to compile. with Ada.Numerics.Generic_Elementary_Functions; procedure F(Value : in Float) is The_Log : Integer := 0; begin The_Log := Integer(Log(Value, 10)); G(Value, The_Log); end;...

Crashing C++ application including ada dll does not generate core dump

How do I get a C++ application including a loaded ada shared library to generate a core dump? I have a C++ application which loads a ada shared library, inside the ada code I get a stack overflow error which causes program termination along with the console output: raised STORAGE ERROR No core dump file is generated even thou I have ...

How to I build a string from other strings in Ada?

I want to output a header line in a log file and then a line of '-' before the data. To do this I create a string of the header and then outpout the same number of '-'. But the below code always fails with a CONSTRAINT_ERROR because the generated string is not 1024 characters. In Ada string assignments require exactly the same length no...

Use of Pragmas in Ada

Can anyone supply me with simple working examples which illustrate the use of pragmas in Ada 2005 ? I understand that pragmas are used to priorities processes, just that I have not come across working examples ! Much appreciated ! ...

Can i get any advantage from Athlon 64 3800 writing a concurrent program on Ada?

I'm limited to ObjectAda 7.2 for particular reason. Do i need to install a 64 bit OS (Win 64x in my case) to write and run such programs? ...

Unable to access members of an Ada generic parameter.

I am trying to write a generic package and one of the operations required is to checksum the data records received over a bus. The record type will vary and it is a generic parameter. However any attempts to access the members of the generic parameter cause a compilation error. The error ... (Ada 95 GNAT 2009) file.adb:XX no selector "...

Find character in string in Ada

Is there a simple way of checking whether a given character is in a string? I know that if the string was simply a range (say 'a'..'z') then I could have used the in operator, but I need something to the lines of char in "- _,.". What's the best way of doing so in Ada? ...

Multiple Type Inheritance in Ada

Suppose I have the following: type blah is abstract tagged record element1 : integer; end record; type blah2 is abstract tagged record element2 : integer; end record; I'm hoping that it's possible that I can do something like this: type blah3 is abstract new blah1 and blah 2 with null record; So in theory I can now access blah3...

Simulating a 6-faced die in Ada-2005

Dear Friends ! I have very definitively come across the 'simulating a 6-faced die' (which produces a random integer between 1 and 6, all outcomes are equally probable) in Java, Python, Ruby and Bash. However, I am yet to see a similar program in Ada. Has anyone come across one ? Kind regards Arkapravo ...

In Ada, why are my attempts to open a file for writing failing?

When I attempt to open a file to write to I get an Ada.IO_Exceptions.Name_Error. The file name is "C:\CC_TEST_LOG.TXT". This file does not exist. This is on Windows XP on an NTFS partition. The user has permissions to create and write to the directory. The filename is well under the WIN32 max path length. name_2 : String := "C:\CC_TE...

gcc, make: how to disable fail on warning?

I'm trying to build gcc for use with an AVR micro controller and avr-ada, and I've hit a roadblock caused by my regular compiler being too picky about the version I needed for the AVR. I get the following warning, which in turn causes the gcc or make to report an error: gcc -c -g -O2 -gnatpg -gnata -nostdinc -I- -I. -Iada -I../../gc...

Can't create file in Ada 95

Hello, I'm trying to follow a standard reference for opening files but running into a constraint_error at the line when I call Ada.Text_IO.Create(). It says "range check failed". Any help appreciated, here's the code: WITH Ada.Text_IO; WITH Ada.Integer_Text_IO; USE Ada.Text_IO; USE Ada.Integer_Text_IO; PROCEDURE FileManip IS --Vari...

How to determine the modulus of a Float in Ada 95

I need to determine the amount left of a time cycle. To do that in C I would use fmod. But in ada I can find no reference to a similar function. It needs to be accurate and it needs to return a float for precision. So how do I determine the modulus of a Float in Ada 95? elapsed := time_taken mod 10.348; left := 10.348 - elapsed; del...

Why are my attempts to open a file using open for writing failing? Ada 95

When I attempt to open a file to write to I get an Ada.IO_Exceptions.Name_Error. The procedure call is Ada.Text_IO.Open The file name is "C:\CC_TEST_LOG.TXT". This file does not exist. This is on Windows XP on an NTFS partition. The user has permissions to create and write to the directory. The filename is well under the WIN32 max pat...