Mail Archives: djgpp/2011/09/09/22:00:14
Eli Zaretskii <eliz AT gnu DOT org> wrote in news:83ty8m5gsz DOT fsf AT gnu DOT org:
>> From: Felix <junkemail AT junk DOT com>
>> Date: 09 Sep 2011 03:54:25 GMT
>> Bytes: 1253
>>
>> program Test
>> real first
>> write (*,'(a)') 'Program to regurgitate a number'
>> write (*,'(a,$)') 'Enter number: '
>> read (*,*) first
>> write (*,'(a,f10.5)') 'Regurgitated number is', first
>> stop
>> end
>>
>> With GCC 4.6.1 and binutils 2.21.1 (or GCC 4.4.2 and binutils 2.19),
>> this program does not properly execute the 'read (*,*)' statement.
>
> Details, please: what did you expect from this program and what
> actually happened?
>
> I'm guessing that you bumped into some buffering issue, but it's
> impossible to help you without more details.
>
> Also, what version of DJGPP library (djdevNNN.zip) do you have
> installed?
>
All three DJGPP installations are on Windows XP SP3 systems. On all
three installations, I have installed djdev203.zip. According to the
files djdev203.ver and djdev203.dsm from the manifest directory, this
corresponds to version 2.03 patchlevel 2, or the June 2002 refresh of
djgpp203. Is there a different library for use with GCC 4.x?
I would expect the program to print the prompt to the console window and
then accept input from that console, echoing it as it is typed in. The
prompt is displayed to the console but when I try to enter a number, I
get no response: no echo of the keys I press. The only way to exit the
program is by hitting the ^C key repeatedly.
By the way, on at least one of the platforms with GCC 4.x installed,
the program behaves the same way even if I include a format specifier
such as '(f10.5)' in the read statement.
I don't normally use DJGPP all that much, really. Lately, I mostly use
it to test things I am likely to use or try out on the Linux machine at
work. In this instance, I was going to test out how Python's subprocess
module can be made to spawn off a Fortran program that requires input
from the console. So I wrote this simple Fortran program to test it out
only to find that this simple Fortran program does not even work when
directly called from the console.
Thanks for any help you can provide.
Felix
- Raw text -