************************************************************************
* File: format.for
************************************************************************
* Scopo: mostrare varie istruzioni FORMAT
************************************************************************

      PROGRAM ProvaFormat
      IMPLICIT NONE
      INTEGER i
      REAL r1, r2
      REAL*8 r3
      COMPLEX c
      LOGICAL l
      CHARACTER*20 s1, s2

      i = 3
      r1 = 3.14
      r2 = 3.14E+1
      r3 = r2
      c = (1,4)
      l = .TRUE.
      s1 = 'CIAO!!!'
      OPEN (8, FILE='FORMAT.TXT')
      WRITE (*,70)
      READ (*,80) S2
      WRITE (8,*) 'File scritto dal PROGRAM ProvaFormat (FORMAT.FOR)'
      WRITE (8,*) '123456789012345678901234567890'
      WRITE (8,10) i
      WRITE (8,10) i
      WRITE (8,20) r1
      WRITE (8,30) r2
      WRITE (8,40) r3
      WRITE (8,50) c
      WRITE (8,60) l
      WRITE (8,*) s1, '*'
      WRITE (8,*) s2, '*'
      CLOSE (8)
      STOP

 10   FORMAT(I8,3H I8)
 20   FORMAT(F8.2,5H F8.2)
 30   FORMAT(E8.2,5H E8.2)
 40   FORMAT(D8.2,5H D8.2)
 50   FORMAT(2H (,E8.2,2H ,,E8.2,2H ))
 60   FORMAT(L8,3H L8)
 70   FORMAT(22H INSERISCI UNA STRINGA)
 80   FORMAT(A20)

      END
