Tutorial

Simple output

Below is a simple program you can enter into your compiler.  Compiling this program will help to familiarize you with the compiler you have chosen.

Reserve or key words are shown in bold letters.

with TEXT_IO;
use TEXT_IO;
procedure TEST is
begin
    PUT ("This is a test.");
end TEST;

TEXT_IO is the name of a package.  Packages contain pre written code to make programmers lives easier.  Each package is made up of several procedures.
PUT is just one of the procedures within the TEXT_IO package.  The text in the brackets is the parameter for PUT.  The quotation marks indicate that a string is being passed.

With tells the program to look for the package named after it.
Use forces the compiler to search through the package named.

Every Ada program must contain a procedure.  To name your procedure you type the key word procedure followed by the name you want to give it.  The name is repeated after the key word end to make it easier to determine which procedure was ended.

Go to the Tutorial Table of Contents