2 ! Program to test reading in a list of integer values into REAL variables.
3 ! The comma separator was not handled correctly.
15 write (buff
,'(a)') '10,20,30,40'
16 read(buff
,*) a
, b
, c
, d
23 if (abs(10. - a
) > 1e-5) STOP 1
24 if (abs(20. - b
) > 1e-5) STOP 2
25 if (abs(30. - c
) > 1e-5) STOP 3
26 if (abs(40. - d
) > 1e-5) STOP 4
32 write (buff
,'(a)') '10.,20.,30.,40.'
33 read(buff
,*) a
, b
, c
, d
35 if (abs(10. - a
) > 1e-5) STOP 5
36 if (abs(20. - b
) > 1e-5) STOP 6
37 if (abs(30. - c
) > 1e-5) STOP 7
38 if (abs(40. - d
) > 1e-5) STOP 8
49 write (buff
,'(a)') '10.0,20.0,30.0,40.0'
50 read(buff
,*) a
, b
, c
, d
52 if (abs(10. - a
) > 1e-5) STOP 9
53 if (abs(20. - b
) > 1e-5) STOP 10
54 if (abs(30. - c
) > 1e-5) STOP 11
55 if (abs(40. - d
) > 1e-5) STOP 12
67 write (buff
,'(a)') '10.0,,30.0,40.0'
68 read(buff
,*) a
, b
, c
, d
70 if (abs(10. - a
) > 1e-5) STOP 13
71 if (abs(-99. - b
) > 1e-5) STOP 14
72 if (abs(30. - c
) > 1e-5) STOP 15
73 if (abs(40. - d
) > 1e-5) STOP 16
87 character(len
=80) buff
93 write (buff
,'(a)') '10,-20,30,-40'
94 read(buff
,*) a
, b
, c
, d
96 if (abs(10. - a
) > 1e-5) STOP 17
97 if (abs(-20. - b
) > 1e-5) STOP 18
98 if (abs(30. - c
) > 1e-5) STOP 19
99 if (abs(-40. - d
) > 1e-5) STOP 20