Previous topic |
Ada Home Page |
Index
Scope example
1 with TEXT_IO; use TEXT_IO;
2
3 procedure main is
4
5 length : constant := 4;
6 str : string (1..length);
7 num : INTEGER;
8
9
10 procedure one (num, len : in INTEGER) is
11
12 str : string (1..10);
13
14 begin -- one
15 ... ... ... ...
16 end one;
17
18
19 X, Y : FLOAT;
20
21
22 procedure two (len : in INTEGER) is
23
24 X : INTEGER;
25
26 begin -- two
27 ... ... ... ...
28 end two;
29
30
31 begin -- main
32 ... ... ... ...
33 end main;
Visibility of each name
| name |
line |
one |
two |
main |
| PUT, etc | 1 | yes | yes | yes |
| length | 5 | yes | yes | yes |
| str | 6 | no | yes | yes |
| num | 7 | no | yes | yes |
| num | 10 | yes | no | no |
| len | 10 | yes | no | no |
| str | 12 | yes | no | no |
| X | 19 | no | no | yes |
| Y | 19 | no | yes | yes |
| len | 22 | no | yes | no |
| X | 24 | no | yes | no |
Previous topic |
Ada Home Page |
Index
c-lokan@adfa.oz.au / 14 Feb 96