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
0 answers

Ada - Prime factorization of numbers

My first homework assignment in Ada is to create a program that states whether a number is composite or prime, display its factors, and then indicate its prime factorization. So for example the number 12 would be composite, 1,2,3,4,6,12. Prime…
Justiciar
  • 356
  • 1
  • 3
  • 20
1
vote
2 answers

EXCEPTION_ACCESS_VIOLATION on a static declaration

I am new with the usage of for ***'Address use ***. And I was wondering what are the limitation of this usage. So I created the following procedure: procedure letshack (A : System.Address) is My_String : String(1..100000); for…
Brighter side
  • 392
  • 2
  • 14
1
vote
2 answers

Ada select multiple entries

I'm looking for a way to select on multiple entries. I've got the following task and select block. The intention is to run multiple (2) tasks elsewhere, run until one completes, or timeout after some amount of time task type t_startup_task is …
LordAro
  • 1,269
  • 3
  • 18
  • 35
1
vote
1 answer

Dynamically sized array elements in Ada

So I have the following Ada array declaration buried inside a package body, that eventually gets passed to a C function declare type t_buffer is array (0 .. ARR_SIZE) of Unsigned_32; buffer : constant access t_buffer := new t_buffer; begin …
LordAro
  • 1,269
  • 3
  • 18
  • 35
1
vote
2 answers

Ada, raised CONSTRAINT_ERROR : bad input for 'Value: "well."

I am unable to get the following script to return my input value; I've looked up ARM as well as John Barnes book but to no avail. In theory it should work. Anyone know why? I'm a newby so the Barnes book and the ARM are probably too advanced for…
ronhans
  • 13
  • 3
1
vote
3 answers

Access first element of string in Ada

I have a string passed into a function, I would like to compare the first character of the string against a number. I.E. if String(1) = "3" then When I compile I get: warning: index for String may assume lower bound of 1 warning: suggested…
onaclov2000
  • 5,741
  • 9
  • 40
  • 54
1
vote
2 answers

Is there anything else to do Audio in 92khz to 192khz?

I spend lot of time researching/finding a best developer friendly framework or libraries for cross platform to deal with solid/accurate/lipsync sort of audio solution. Still could not find one which can be used for cross platform. I tried GStreamer…
user285594
1
vote
2 answers

Instantiating non-library-level package in SPARK Ada

How do I instantiate a non-library-level package in SPARK Ada? Say I have something like: subtype Die is Integer range 1..6; package Random_Die is new Ada.Numerics.Discrete_Random(Die); That gives me the errors: instantiation error at…
digitig
  • 1,989
  • 3
  • 25
  • 45
1
vote
2 answers

Ada: Entry meaning

I am an absolute beginner with Ada, and there's one thing I cannot find a concrete definition for - that's the statement entry. I understand an entry with a barrier - if the barrier is true, the statement can execute and if false, the task is queued…
User9123
  • 29
  • 1
  • 2
1
vote
1 answer

GNAT How to make first array ada program, no languages defined for this project

I have Windows 10 64bit and I installed GNAT programming studio (no settings are made like java jdk) just installed. I want to make my first Ada programe in GPS GNAT programming studio. Based on this example, following is Arrayproject.adb: with…
1
vote
2 answers

Wait for tasks in Ada

I have a procedure with tasks in it. I have to do something after the all of the tasks terminated. How can I do that?
user408141
1
vote
1 answer

Port Solaris Ada running on Sparc to PC

I have inherited a very old tool which our customer wants to keep alive for another 20 years. This tool was developed using Sparc Ultra 1 workstations with Sun OS 5.6 and SPARCworks Ada 3.0 and Rational Ada 6.2.3c. Half of the tool runs on the…
BartJ
  • 21
  • 2
1
vote
1 answer

Forcing a message loop to yield

I hope this question isn't too broad. I'm working with a legacy Ada application. This application is built around a very old piece of middleware that handles, among other things, our IPC. For the sake of this question, I can boil the middleware's…
Kevin
  • 510
  • 4
  • 16
1
vote
0 answers

gprbuild/gprinstall doesn't respect encoding

Building Ada sources for multiple projects, with installing the libraries and sources after each project build, works fine for gnatmake and a gnat.adc containing pragma Wide_Character_Encoding(UTF8); but not for gprbuild, no matter what I…
Patrick Kelly
  • 633
  • 5
  • 22
1
vote
1 answer

How to use GtkAda in command-line?

I try to compile a very simple GtkAda application in command-line, on Windows. Here is the app code: `WITH Gtk.Main ; USE Gtk.Main ; WITH Gtk.Window ; USE Gtk.Window ; PROCEDURE Test01 IS win : Gtk_window ; BEGIN Init ; …
yO_
  • 1,135
  • 2
  • 12
  • 18