Re: Clear Screen



Rosana Khan <khanrosana@xxxxxxxxx> 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
Windows).

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
.



Relevant Pages

  • Re: This is not a troll. I like Fortran
    ... teletype-related output. ... Later came screens which Fortran supported in ... To get acceptance, both in universities and in the workplace, Fortran ... Compilers are now VERY expensive PER SEAT and getting coloured text, ...
    (comp.lang.fortran)
  • Re: Animating Graphics
    ... operations by using API's called from Fortran. ... That is until last week when I updated my Win XP with SP3  release candidate ... (300+ mb download) ... to get the effect of two screens. ...
    (comp.lang.fortran)
  • Re: Animating Graphics
    ... I've been doing the same in Fortran. ... panels. ... write-to-screen operation uses. ... to get the effect of two screens. ...
    (comp.lang.fortran)
  • Re: How can I call system commands in fortran
    ... > I need a program routine in Fortran to: ... how can I call system commands in Fortran. ... Calling system commands was only added to Fortran in the 2003 standard, ... but I think some compilers let you access the contents of a directory ...
    (comp.lang.fortran)
  • RE: How can I call system commands in fortran
    ... how can I call system commands in Fortran. ... Please consult your compiler documentation, ... If you specify your compiler you will get ...
    (comp.lang.fortran)