Yurttas/PL/IL/Ada-95/ProgUnits/G/ex 02.adb

From ZCubes Wiki
Jump to navigation Jump to search
 1--
 2-- Copyright (C) 1998
 3-- All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4--
 5-- Permission to use, copy, modify, and distribute this
 6-- software and its documentation for EDUCATIONAL purposes
 7-- and without fee is hereby granted provided that this
 8-- copyright notice appears in all copies.
 9--
10--
11 
12-- date   : January 1, 1998.
13-- author : Salih Yurttas.
14
15-- purpose : to demonstrate a procedure structure which
16--           is the essence of Ada-95 programming structuring and
17--           composition.
18
19-- ex_02.adb
20
21
22with Text_IO; use Text_IO;
23
24procedure EX_02 is 
25
26  package Int_IO is new Integer_IO(Integer); use Int_IO;
27
28  X : Integer := 2;
29  Y : Integer := 8;
30
31  T : Integer;
32
33begin
34
35  New_Line;
36  Put_Line("before / ");
37
38  Put("X = ");
39  Put(X,1);
40  New_Line;
41
42  Put("Y = ");
43  Put(Y,1);
44  New_Line;
45
46  T := X;
47  X := Y;
48  Y := T;
49
50  New_Line;
51  Put_Line("after / ");
52
53  Put("X = ");
54  Put(X,1);
55  New_Line;
56
57  Put("Y = ");
58  Put(Y,1);
59  New_Line;
60
61end EX_02;