Trailing-Edge
-
PDP-10 Archives
-
FORTRAN-10_V7wLink_Feb83
-
ifthel.for
There are 9 other files named ifthel.for in the archive. Click here to see a list.
PROGRAM IFTHEL
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 Simple program to test IF-THEN-ELSE statements.
C-100- Regular IF
A=24.5
IF (A.NE.24.5) TYPE 100,A
100 FORMAT(' ?Error 100. A='F', should =24.5')
C-200- IF-THEN
IOK=0
IF (A.EQ.24.5) THEN
IOK=1
ENDIF
IF (IOK.NE.1) TYPE 200,IOK
200 FORMAT(' ?Error 200. IOK='I4', should = 1')
C-300- IF-THEN-ELSE
JJ=5
IOK=0
IF (JJ.LT.4)
1 THEN
TYPE 310
310 FORMAT(' ?Error 310! Took THEN branch')
ELSE
IOK=1
ENDIF
IF (IOK.NE.1) TYPE 320
320 FORMAT(' ?Error 320. ELSE branch not taken')
C-400- IF-THEN-ELSE-IF
IF (JJ.LT.4) THEN
TYPE 400
400 FORMAT(' ?Error 400. THEN branch taken.')
ELSE IF (JJ.GT.4)
1 THEN
IOK=1
ELSE
TYPE 410
410 FORMAT(' ?Error 410. ELSE branch taken.')
ENDIF
IF (IOK.NE.1) TYPE 420
420 FORMAT(' ?Error 420. THEN branch not taken.')
END