main
| Line | |
|---|
| 1 | ! Using a common block where the first 8 bytes are taken by
|
|---|
| 2 | ! a double precision variable in MAIN, and by two reals in
|
|---|
| 3 | ! SUB. Also, the last variable in the common block (PAD2)
|
|---|
| 4 | ! is not made visible inside SUB.
|
|---|
| 5 | PROGRAM MAIN
|
|---|
| 6 | INTEGER A
|
|---|
| 7 | REAL F,R,X,Y
|
|---|
| 8 | DOUBLE PRECISION PAD, PAD2
|
|---|
| 9 | COMMON PAD,R,A,F,PAD2
|
|---|
| 10 | A = 5
|
|---|
| 11 | R = 3.5
|
|---|
| 12 | CALL SUB(X,Y)
|
|---|
| 13 | PAD = F
|
|---|
| 14 | WRITE(*,*) PAD
|
|---|
| 15 | END
|
|---|
| 16 |
|
|---|
| 17 | SUBROUTINE SUB(P,Q)
|
|---|
| 18 | INTEGER I
|
|---|
| 19 | REAL A,B,P,Q,PAD,PAD2
|
|---|
| 20 | COMMON PAD,PAD2,A,I,B
|
|---|
| 21 | PAD = A
|
|---|
| 22 | PAD2 = I
|
|---|
| 23 | B = PAD2 + 2*PAD
|
|---|
| 24 | END
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.