1

I want to write data in console in random position. For example, if there 25 rows by 80 symbols and I want to write some number or char to second row and 60 symbol, I use something like this:

CALL Gprint(60,2,'H')

or this:

CALL Gprint(80,25,Arr)

where Arr - 80*25 array of characters.

I am using Intel Fortran XE 14.

Artemi A.
  • 36
  • 5
  • All you can do is write appropriate control codes for your console to stdout. If you have a vt100 compatible console (mode linux-ish terminals) for example the codes are well documented and pretty simple to implement in fortran. – agentp Apr 11 '17 at 14:28
  • You should tell us which OS you use. The escape codes are here http://en.wikipedia.org/wiki/ANSI_escape_code They will not work in the Windows terminal, but you don't need a specific vt100 compatible. See http://stackoverflow.com/a/10919072/721644 for an example. A practical guide is http://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html – Vladimir F Героям слава Apr 11 '17 at 14:53
  • *"some code or library to detect position of mouse click"* belong somewhere else. It would belong to a different question, but it is off-topic anyway. – Vladimir F Героям слава Apr 11 '17 at 14:54
  • I am using windows+intel fortran+vs2012. >It would belong to a different question, but it is off-topic anyway hah, topic question is off-topic?) – Artemi A. Apr 12 '17 at 12:15

1 Answers1

1

Fortran does not do by itself what is asked; conventional approaches to this use curses (ncurses), termcap (or terminfo). Given the compiler, that sounds like a Linux system. You may find this useful:

If it were Windows, that specific question has already been asked:

Community
  • 1
  • 1
Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105