| Aicha Mouline
|
259
|
 |
|
03-23-2001 01:45 AM ET (US)
|
|
Hi ST, The program outputs the value of the global variable B because function main "knows" only the global B. The local variable B declared in p2 is not visible within main(). Concerning the value of A, the last update of this global variable (before being output), is during the execution of procedure p1 called by p2. In the statement A:=B, variable A is assigned the value of the B (local) since that local B is the B "known" to p2 (the calling procedure). Let me know if you are still confused.
Aicha
|