An usual read
statement in Fortran interrupts the execution of the program until the RETURN key was pressed. I am looking for a statement that reads any pressed key without waiting for the RETURN key. The program should not stop even if no key was pressed.
Thank you for your answer.
Edit: Here is some source code that should clarify the question.
Program test1
n=2
do while (n==2)
read (*,*) n
write (*,*) 'Output'
end do
end program test1
Program test2
n=2
do while (n==2)
UnknownReadStatement (*,*) n
write (*,*) 'Output'
end do
end program test2
The program test1
will never write the word "Output" on the screen if no key is pressed.
Using the read statement I am looking for the program test2
should fill the screen with "Output" until a key different from "2" is pressed.