ada

ADA Real_time string

Possible duplicate: How to convert a Ada.Real_TIme.Time to a string? How can I convert a Time type obtained with a Ada.Real_Time.Clock to a String type in Ada ? ...

The use of IN OUT in Ada

Given below is some code in ada with TYPE_VECT_B; use TYPE_VECT_B; Package TEST01 is procedure TEST01 ( In_State : IN VECT_B ; Out_State : IN OUT VECT_B ); function TEST02 ( In_State : IN VECT_B ) return Boolean ; end TEST01; The TYPE_VECT_B package specification and body is...

The use of insert in ada?

Hi all, Can anyone please tell me the usage of Insert in Ada language. I had tried the net but i couldn't just figure out. It would be a great help if anyone could provide me with examples too. Thanks in advance Maddy ...

ada programming doubts?

I have two ada files shown below A1.ada procedure KOR616 is I : Integer := 3; procedure Lowest_Level( Int : in out Integer ); pragma Inline( Lowest_Level ); procedure Null_Proc is begin null; end; procedure Lowest_Level( Int : in out Integer ) is begin if Int > 0 then Int := 7; ...

Append file operation in Ada

Hi, I'm very new to Ada and one thing that I find hard to grasp is working with Files in Ada when it comes to append some values in a file. It seems easier for me to do so in C. Anyway, I haven't found good information and I hope someone could help me here. I declare the following first: PACKAGE Seq_Float_IO IS NEW Ada.Sequential_I...

Ada file operation: instantiation and exception

Hi, I'm learning Ada and I need some clarifications on file operations. I have just one type: float and I have to create 2 files that will store float values (with append operation). So I'm instantiating a package for the type float and I then declare 2 file variables X_File and Y_File. Then I put exceptions in case the files don't al...

AdaGide: debug mode and release mode

hi, If I understand correctly then the release mode enables a program to run faster than running the program in debug mode. A general question will be if one has to run the program first in debug mode and then switch to run the program in release mode in order for the release mode to "skip over" checks it normally makes when running...

Procedure to open, write and append in Ada

This question is a follow-up of the post at http://stackoverflow.com/questions/3171332/ada-file-operation-instantiation-and-exception about writing to files in Ada. I chose to place this question in a separate post so that it'll become visible to more people as I already accepted an answer on a slightly different issue (which was on ...

Constant declaration in Ada

Being new to Ada, I'm exploring its syntax and rules and I would like to draw attention on the code given next. Here I'm trying to set a variable Actual_Stiffness to hold a constant value. Its value is given by the product: Actual_Stiffness := Stiffness_Ratio * Stiffness_Total where Stiffness_Total has been defined to be a constant L...

Ada: constant declaration

Hi, I'm reading Norman Cohen's Ada 95 book and on page 129 we have the constant declarations: Pi: constant Float := 3.1415926536 and Pi: constant := 3.1415926536 The second declaration is said to be interpreted as, I quote: "any floating-point of fixed-point type with the appropriate range". My question is say one is working w...

Ada matrix package

Hi, I'm in search for a free package that do most matrix/vector operations. I can write some basic functions myself but for advanced ones like computing eigenvalues and eigenvectors I would prefer robust code and I would like to know if such packages are freely available. If I understand correctly Ada 2005 have more matrix operations fac...

Ada manuals: difference between annotated and consolidated...

Hi, what's the difference between the Consolidated Ada Reference Manual 2005 Edition (ISO/IEC 8652:2007(E), Ed. 3) from Springer and the Annotated Ada Reference Manual (ISO/IEC 8652:1995(E)) 2005 Edition? The Annotated Ada Reference Manual is marked as Draft 16. If I understand correctly, the consolidated version is the final version of ...

Ada: plotting 2d graphs

Hi, it would be interesting to be able to plot a 2D graph within an Ada code rather than having to save values say to file and use an external drawing software afterwards. A search on the web has taken me to two packages: Win_IO and JEWL. I have been able to use WIN_IO though but the documentation is quite poor and having just started us...

Ada: cmake and PLplot installation on Windows

This is a follow-up of the post at http://stackoverflow.com/questions/3210207/ada-plotting-2d-graphs . I decided to create a new post as this is a separate issue. The installation of PLplot for Windows is at: http://www.miscdebris.net/plplot_wiki/index.php?title=Specifics_for_various_platforms#Windows . The installation is as follows: c...

Software engineering with Ada: stubs; separate and compilation units

Hi, I'm with a mechanical engineering background but I'm interested to learn good software engineering practice with Ada. I have a few queries. Q1. If I understand correctly then someone can just write a package specification (ads) file, compile it and then compile the main program which is using the package. Later on, when one knows wh...

Ada: how to access this variable?

Hi, I have a modified textbook example as follows (the book is Understanding Ada---a software engineering approach by Bray and Pokrass): PACKAGE SOLAR_SYSTEM IS TYPE PLANET IS (MERCURY, VENUS, MARS, JUPITER, SATURN, NEPTUNE); SUBTYPE TERRESTRIAL_PLANET IS PLANET RANGE MERCURY..MARS; SUBTYPE JOVIAN_PLANET IS PLANET RANGE JUPITER..NE...

Ada: float instantiation from another package

Hi I'm trying to create a new Float type with 6 digits precision. But it seems that I'm not able to use it. Here's the code from the package MyFloat_IO.ads WITH Ada.Text_IO; PACKAGE MyFloat_IO IS TYPE MyFloat IS DIGITS 6 RANGE 0.0..Float'Last; PACKAGE MyFloat_IO IS NEW Ada.Text_IO.Float_IO(MyFloat); end MyFloat_IO; and the main ...

Ada: windows installation

Hi, When downloading the tar file from AdaCore for the GNAT compiler (the libre version), I noticed that there are two exe files for installation purposes: win32ada-gpl-2010.exe of size 2.67 MB and gnat-gpl-2010-i686-pc-mingw32-bin.exe of size 70.2 MB In the folder containing the second one, there are instructions for the installa...

Ada: optimize pragma

Hi, in the quest to make an Ada code run faster, I'm including the pragma optimize time in the code (in the declarative part). On compiling in AdaGIDE using the GNAT Ada libre Core compiler, I get a warning message: pragma Optimize(Time); | >>> warning: insufficient -O value In the Global settings in the AdaGIDE edit...

Ada: attribute 'last and 'safe_large

Hi, it's very common in Ada to create a derived type say a new Float type with the last element being Float'Last. I have not yet seen someone using Float'Safe_Large instead of the attribute Float'Last when defining a new Float type. On my 32-bit machine, both Put( Float'Image( Float'Last )); and Put( Float'Image( Float'Safe_large ))...