https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105473

--- Comment #7 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
My apologies for taking some time to get back to this.  After a closer look, I
realize that in the original test case there is no problem.  The semicolon is
an acceptable value separator regardless of decimal='point' or decimal='comma'

Take these two examples:

1) The comma is the decimal keeper so semicolon must be used as the separator

  implicit none
  integer n,m,ios
  real r
  character(20):: testinput = '1;17;3,14159'
  n = 999
  print *,'testinput = "',testinput,'"'
  read(testinput,*,decimal='comma', iostat=ios) n, m, r
  print *,'n=',n,' m= ', m,' r= ', r,' ios=',ios
  if(ios>0) print *,'testinput was not an integer'
end program

2) The point is the decimal keeper so semicolon may be used as the separator or
a comma

  implicit none
  integer n,m,ios
  real r
  character(20):: testinput = '1;17;3.14159'
  n = 999
  print *,'testinput = "',testinput,'"'
  read(testinput,*,decimal='point', iostat=ios) n, m, r
  print *,'n=',n,' m= ', m,' r= ', r,' ios=',ios
  if(ios>0) print *,'testinput was not an integer'
end program

In the original test case, the semicolon is a separator and is simply ending
the read as no value is there.

Reply via email to