24.11.2014 Views

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Assignment Statements<br />

Example:<br />

CHARACTER C1*10, C2*5, C3*7<br />

LOGICAL L1, L2, L3<br />

INTEGER*2 K, L<br />

I = S = J = T = 1.25<br />

PRINT *, I, S, J, T<br />

I = K = J = L = 70000<br />

PRINT *, I, K, J, L<br />

C1 = C2 = C3 = ’ABCDEFGHIJKL’<br />

PRINT *, C1, C2, C3<br />

L1 = L2 = L3 = .TRUE.<br />

PRINT *, L1, L2, L3<br />

END<br />

The output from this program would be:<br />

1 1.0000000 1 1.2500000<br />

4464 4464 4464 4464<br />

ABCDE ABCDEABCDEFG<br />

T T T<br />

Note that variables K and L are of type INTEGER*2 and cannot contain any value greater than 32767.<br />

Truncation resulted and this value (4464) was propagated to the left.<br />

Extended Assignment Statement 191

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!