Questions tagged [ada]

Ada is a structured, statically typed, imperative, wide-spectrum, and object-oriented high-level computer programming language, extended from Pascal and other languages.

Ada is a structured, statically typed, imperative, wide-spectrum, and object-oriented high-level computer programming language, extended from Pascal and other languages.Wikipedia

New to Ada?

Welcome! For learning any language, starting off with a good book is highly recommended. Ada is no different. Ada is different however in the number and quality of online resources available for free. A good starting point is the list of Ada Books On-Line. Once you have some basic learning under your belt, many find Ada LRM to be all the reference they ever need. The Ada Information Clearinghouse also provides a lot of useful links for learning Ada.

If you are looking for a good compiler, GNAT is a production-quality GCC-based Ada compiler that is freely available for Windows, OS X, and Linux; more here. Support and more platforms are available from AdaCore. If you want a more Windows-native compiler, Aonix ObjectAda uses the Microsoft linker, so it can be easier to use in an integrated Windows environment.

Versions

There are multiple versions of the language, named based on the year the ISO standardized the language. Thus there currently are Ada83, Ada95, Ada2005 and Ada2012. Any of those can be referenced as Ada, although the term is more appropriate for the latest version of the language.

Have a question?

When you ask a question, be sure to include any relevant source code. Try to keep the code as minimalist as possible while still reproducing the problem; often the problem will be found during the process. If there are any compiler errors, be sure to indicate:

  • Which compiler you are using?
  • Exactly what errors are shown?
  • On which lines do they occur (mark the lines with comment)?

It is recommended to enable syntax highlighting in the source code that you add to the question. Use the following syntax:

``` lang-ada
-- Ada source code goes here
```

External FAQs

Other External Resources

2354 questions
1
vote
1 answer

Ada - try to call entry of element of array of protected type, if busy - try next element

I'm working on a multithreading project and i have one array of tasks, let's call it A and one array of protected, let's call it B. Now every element of A at some point will want to access entry from one of the elements of B. Is there a way to…
tomiQrds
  • 95
  • 10
1
vote
1 answer

The use of insert in ada?

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
maddy
  • 827
  • 2
  • 11
  • 19
1
vote
1 answer

Ada Os independent adapter iteration

In Ada how can I best iterate over adapters (to find the assigned IP and subnet) in a OS independent manner? Is there a package like Gnat Sockets that I can use? Below is the code we currently use - however this is uses the Windows API directly. How…
AhlanM
  • 21
  • 2
1
vote
1 answer

Indexer and reference type for dynamic arrays in Ada

I have the following spec: generic type Value_Type is private; package Containers.Arrays is type Static_Array is array(Positive range <>) of Value_Type; type Static_Array_Access is access all Static_Array; type Dynamic_Array is…
Patrick Kelly
  • 633
  • 5
  • 22
1
vote
1 answer

Want to use an Ada dll in Unity C#, but getting Entry Point Not Found Exception?

I have a dll that was written in ada, and I'd like to use it in a Unity project, with C#. The problem is that I'm getting an EntryPointNotFoundException error. For example, the ada code contains a function Initialize_Test, that returns a long. From…
pdonk
  • 11
  • 2
1
vote
2 answers

Why does an indefinite aggregate slide but a definite one does not?

This is one of those academic things I'd just like to understand better. (I have no justification for why one would write code like this.) If you have code that starts with an indefinite type like type Indef is array (Integer range <>) of…
Tod
  • 8,192
  • 5
  • 52
  • 93
1
vote
1 answer

How to decode string in specific charset and then encode it in UTF-8?

How, in Ada, do I decode a string coming from the MS Windows terminal, then encode it in UTF-8?
Ana C.
  • 13
  • 4
1
vote
1 answer

Case statement execution steps

I have the following case statement: A = 1 case A is when 1 => A = 2; => Run; when 3 .. 15 => null; when 16 | 17 => Jump; when 2 | 18..35 => Swing; when…
galasm3
  • 11
  • 2
1
vote
3 answers

Ada: How to define a random constant?

I am currently working through John English' "Ada 95: The Craft of Object-Oriented Programming". I am at task 5.1: Write a program to play a simple guessing game. Define an integer type with a range of values from 1 to 1000 and declare a secret…
alex
  • 1,277
  • 3
  • 14
  • 30
1
vote
1 answer

Ada SDL Unchecked Union passed from C binding

I'm using AdaSDL2, a third-party binding to a C library. Events in SDL are handled via a union, as seen at this reference: http://www.willusher.io/sdl2%20tutorials/2013/08/20/lesson-4-handling-events/ Problem is that the binding defines the…
Devsman
  • 434
  • 4
  • 17
1
vote
1 answer

Passing String to C function

I'm looking at different ways of passing string to C functions. Here is a example on 4 different way to to that and the code is tested and it works. with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; use Interfaces.C.Strings; with…
Jossi
  • 1,020
  • 1
  • 17
  • 28
1
vote
2 answers

Datatype of variable in ada

How can I find the datatype of a variable in Ada? For example, given INT : integer; how can I print "the datatype is integer" for this variable? In Python, type() can be used to find the type. Is there any similar function in Ada to find the…
1
vote
4 answers

Ada- attempting to remove blank spaces from a string?

This question is in regards to a program I'm working on for an intro to programming class in Ada. The only packages I can use are the basic text, integer, and float packages. I'm writing a procedure right now to remove the spaces from the string and…
Lareaper
  • 31
  • 1
  • 6
1
vote
2 answers

Doubts in ada language involving procedures

I am a beginner in Ada and I have come across a piece of code which is shown below: procedure Null_Proc is begin null; end; Now as per my knowledge the procedure in Ada…
maddy
  • 827
  • 2
  • 11
  • 19
1
vote
2 answers

Check run-time memory use/consumption Ada95?

G'day, I am on look-out for some kind of tool or library I can use with Ada95 for to check or report current runtime memory used/in use. So far I've not had much luck. I am here because perhaps one of the community has had such a challenge and you…
will
  • 4,799
  • 8
  • 54
  • 90
1 2 3
99
100