Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with read statement

Status
Not open for further replies.

tesaoghost

Programmer
Jan 9, 2014
11
Hi every body
I am new to this forum and I have a question about fortran read statement. I want to send cursor to a specified position in output screen and enter data at that position. Take a look at these lines:

program GaussElimination
implicit none

print *,"PLEASE ENTER DIMENSION OF (A) MATRIX (n):"
Read *,n


I want to enter n at the same line after print statement. But cursor jumps to the next line after print statement automatically.
How should I enter the n at the same line?
Thanks a lot
 
Use the option [highlight]advance='no'[/highlight] in the write statement.
 
Thanks a lot
It really works!
But can I use this formatting with print statement or it works with write statement only?
 
tesaoghost said:
can I use this formatting with print statement or it works with write statement only?

IMO it works only with WRITE, because PRINT doesn't seem to contain this option:

Code:
>>-PRINT--+-name----------------------------+------------------><
          '-format--+---------------------+-'
                    '-,--output_item_list-'

Code:
>>-WRITE--(--io_control_list--)--+------------------+----------><
                                 '-output_item_list-'

...
io_control
...
ADVANCE= char_expr
...
see the syntax rules on IBM pages:
PRINT
WRITE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top