Google
 

Trailing-Edge - PDP-10 Archives - BB-4157F-BM_1983 - fortran/test/ioexpr.for
There are 9 other files named ioexpr.for in the archive. Click here to see a list.
	PROGRAM IOEXPR

C THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
C   OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
C 
C COPYRIGHT (C) DIGITAL EQUIPMENT CORPORATION 1983

C	August 1981
C	CDM

C	Test for expressions on I/O statments.

C-100-

	WRITE(20) 1,2,3,4+1
	CLOSE(20)

	READ(20) J1,J2,J3,J4

	IF (J1.NE.1) TYPE 100,J1
	IF (J2.NE.2) TYPE 110,J2
	IF (J3.NE.3) TYPE 120,J3
	IF (J4.NE.5) TYPE 130,J4
100	FORMAT(' ?Error 100. J1='I4', should =1')
110	FORMAT(' ?Error 110. J2='I4', should =2')
120	FORMAT(' ?Error 120. J3='I4', should =3')
130	FORMAT(' ?Error 130. J4='I4', should =5')

C-200-	Formatted I/O.

	I=2; J=3
	X=24.5
	II=0
	K=1

	WRITE(21,200) I+J,24.5/X,(II+K, II=-1,2),II
200	FORMAT(I,F,5I)

	CLOSE(21)

	READ(21,200) J1,X2,J3,J4,J5,J6,J7

	IF (J1.NE.5) TYPE 210,J1
	IF (X2.NE.1) TYPE 220,X2
	IF (J3.NE.0) TYPE 230,J3
	IF (J4.NE.1) TYPE 240,J4
	IF (J5.NE.2) TYPE 250,J5
	IF (J6.NE.3) TYPE 260,J6
	IF (J7.NE.3) TYPE 270,J7
210	FORMAT(' ?Error 210. J1='I4', should = 5')
220	FORMAT(' ?Error 220. X2='F', should = 1.')
230	FORMAT(' ?Error 230. J3='I4', should = -1')
240	FORMAT(' ?Error 240. J4='I4', should = 0')
250	FORMAT(' ?Error 250. J5='I4', should = 1')
260	FORMAT(' ?Error 260. J6='I4', should = 2')
270	FORMAT(' ?Error 270. J7='I4', should = 3')

	END