Rosana Khan <khanrosana> wrote:
> I am having some trouble with clearing screen. I can't find any way to
> do this in Fortran.
That's because it is not a Fortran matter.
> Documents from http://www.ibiblio.org say that
> WRITE(*,*) CHAR(27), '[2J'
> statement will clear the screen. But it is not working for me. I used
> CALL SYSTEM('cls') or CALL system('clear'); but I dont like the idea.
> Is there any other way in Fortran to do that?
It depends on your specific sytem and compiler. There is no general way.
The first method you showed depends on the system accepting ANSI X.25
terminal escapes. Some systems do. Some don't. For a while it was fairly
common, but it seems to be becomming less so in some systems (notably
> Another thing - How can I access printer from a Fortran program?
Same thing. This isn't a Fortran matter. Fortran doesn't know about
specific hardware devices like terminal screens and printers. (Neither
do most other languages). The details depend entirely on your specific
system. Some systems have special device names that you can write to to
print. Details vary. However, it is generally more portable to write the
output to an ordinary file and then execute appropriate system commands
to print that file. The system commands for that will vary.
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain