On 22 apr, 10:53, SimonG <si...@[EMAIL PROTECTED]
> wrote:
> I have built the following program with both ifort (Intel) and g95 but
> they yield different results:
>
> program ex
> =A0 implicit none
> =A0 real(8) :: x
> =A0 integer :: n
> =A0 character(10) :: buff
>
> =A0 do
> =A0 =A0 =A0write(6,'(a)',advance=3D'no') '> '
> =A0 =A0 =A0read(5,*) buff
> =A0 =A0 =A0read(buff,*,err=3D900) x
> =A0 =A0 =A0write(6,'(2a)') 'Number:',trim(buff)
> =A0 =A0 =A0cycle
> 900 =A0continue
> =A0 =A0 =A0write(6,'(2a)') 'Command:',trim(buff)
>
> =A0 end do
>
> end program ex
>
> On the Intel version entering '+' results in 'Command:+' whereas with
> the g95 version the result is 'Number:+'. I expected the Intel result
> but perhaps the standard is ambiguous on this. Is this a g95 bug?
>
> A second question: how do I enter a '/' character?
>
> Thanks,
>
> Simon Geard
With list-directed input a bare / ends the input, as you know. Put it
in '' or "" and it should work.
I do not know the answer to your other question though, but such edge
cases might indeed be ambiguously (or not at all) treated in the
standard.
Regards,
Arjen


|