Google
 

Trailing-Edge - PDP-10 Archives - FORTRAN-10_V7wLink_Feb83 - do.for
There are 11 other files named do.for in the archive. Click here to see a list.
	PROGRAM DO

! This software is furnished under a license and may only be used
! or copied in accordance with the terms of such license.

! Copyright (C) Digital Equipment Corporation 1981, 1983

!	Version 7	DO.FOR

!	Basic testing of DO loops.
!	The number of times the loop is executed is counted
!	then checked.

	ICOUNT=0
	DO 100 I=1,10
	ICOUNT=ICOUNT+1
100	CONTINUE
	IF (ICOUNT.NE.10) TYPE 110,ICOUNT
110	FORMAT(' ?Error line 100 ICOUNT='I6', should =10.')

	ICOUNT=0
	DO 200 I=100,11,-1
	ICOUNT=ICOUNT+1
200	CONTINUE
	IF (ICOUNT.NE.90) TYPE 210,ICOUNT
210	FORMAT(' ?Error line 200 ICOUNT='I6', should = 90.')


!	Simple implied DO loops and repeating Formats

300	WRITE(23,310) (I, I=1,20,2)
310	FORMAT(I)
	CLOSE(23)

	IEXPT=1
	DO 320 I=1,10
	READ(23,310) IVAR
	IF (IVAR.NE.IEXPT) TYPE 330,IVAR,IEXPT
	IEXPT=IEXPT+2
320	CONTINUE
330	FORMAT(' ?Error line 300 - Implied Do loops.')

	STOP
	END