Re: Press any key to continue?
- From: user1 <user1@xxxxxxxxxxx>
- Date: Sun, 30 Mar 2008 10:51:13 -0400
Bamm wrote:
Sorry if this is a stupid question, but how do you do a "Press any keyWhy not just "Press RETURN to continue" ?
to continue"? PAUSE will require you to type "go" while READ *
requires that you press the Enter key.
Because I'm working on a homework which we are supposed to translate a
program from QBX (Microsoft QuickBasic PDS 7.1) to g77. I couldn't
find a fortran equivalent for the following line:
Do Until Len(Inkey$): Loop
It doesn't have to be a direct equivalent in code, but it should work
the same way. :)
I think you might be able to use the getchar() function from the C library.
print *,'Press any key to continue...'
call getchar()
print *, 'Done'
end
You will need to compile with a special option, i.e.
g77 -fno-underscoring whatever.f
.
- Follow-Ups:
- Re: Press any key to continue?
- From: Bamm
- Re: Press any key to continue?
- References:
- Press any key to continue?
- From: Bamm
- Re: Press any key to continue?
- From: Luka Djigas
- Re: Press any key to continue?
- From: Bamm
- Press any key to continue?
- Prev by Date: Re: Press any key to continue?
- Next by Date: Re: Reference to derived type element by index?
- Previous by thread: Re: Press any key to continue?
- Next by thread: Re: Press any key to continue?
- Index(es):