ppp
ppp

Reputation: 2055

fortran read statement

Newbie question, but I can't find some good fortran documentation anywhere.

I am studying a program and the writer uses a read statement to evaluate if the user wants to rerun the script.

The code is:

PRINT *,'Calculate again? .TRUE./T/t -> yes , .FALSE./F/f -> no'
READ *,answer

Then it uses the logical variable answer to select where does the program have to goto next.

What does the code above do?

Upvotes: 0

Views: 883

Answers (2)

M.S.B is right, I just add what did not fit into a comment.

There are tons of good Fortran resources on the internet. You can use official standard, but better are usually documantation for compilers. This one http://publib.boulder.ibm.com/infocenter/comphelp/v111v131/index.jsp?topic=%2Fcom.ibm.xlf131.aix.doc%2Flanguage_ref%2Fassociatestmt.html is very good.

Also there are numerous courses and tutorials. Just google "Fortran beginner course", "Fortran tutorial" or similar.

Upvotes: 3

M. S. B.
M. S. B.

Reputation: 29381

Probably it is supposed to be READ *, answer to read answer from the standard input unit.

The code outputs "Calculate again? .TRUE./T/t -> yes , .FALSE./F/f -> no" then reads into answer, which I suppose is declared as a logical variable.

See http://en.wikipedia.org/wiki/Fortran_95_language_features for documentation of Fortran 95.

Upvotes: 4

Related Questions