Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29246 토론

writing on a fixed line into a console

tropfen
새로운 기여자 I
529 조회수
Hello,

is it possible to write on a fixed position into a console line? (Meaning no new line for each write(6,...))

If yes how?

Thanks in advance
Frank
0 포인트
3 응답
Les_Neilson
소중한 기여자 II
529 조회수

Have a look at the WRITE with Advance=NO option.

Does this do what you want?

Les

0 포인트
jparsly1
새로운 기여자 I
529 조회수

Here's one way using some of the routines provided with CVF. The GOTOXY

routine allows you to set the cursor position in the console window.Probably works

with IVF too, although the USE statements might be a little different...

call gotoxy(10,20)
write(*,*) 'row 10 column 20'
call gotoxy(20,10)
write(*,*) 'row 20, column 10'
read(*,*) ii
stop
end


subroutine gotoxy(irow,icol)
use dflib
use dfwin
integer fhandle
logical lstat
Type(T_COORD) wpos
fhandle = GetStdHandle(STD_OUTPUT_HANDLE)
wpos.x = icol
wpos.y = irow
lstat = SetConsoleCursorPosition(fhandle, wpos)

return
end

0 포인트
tropfen
새로운 기여자 I
529 조회수
Hello Les,

yes.

Your way will do it in 99% of the problems.

Frank
0 포인트
응답