Article View: comp.lang.modula2
Article #4837Re: beginner's stupid question
From: Ray Howard
Date: Thu, 18 May 1989 14:48
Date: Thu, 18 May 1989 14:48
100 lines
4129 bytes
4129 bytes
> > From: CBWP8008@IRUCCVAX.UCC.IE (Ian Murphy)
> > Subject:RE: beginner's stupid question
> > Date: 12 May 89 14:58:00 GMT
> > Message-ID:<INFO-M2%89051211453398@UCF1VM>
> > I don't think it's provided in standard modula, not to matter, what you have
t
> > o
> > do is to write an esc sequence (i.e <esc>something) the something will depen
d
> > on the terminal type you're using. I'd guess you're using vt100s so the best
> > thing would be to simply ask your computer center if you could have a look a
t
> > the ref. manual for the type of terminals you use there.
>
Escape sequences are a kludge, one cannot depend on the users using a
supported terminal, leave it the the operating system or a termcap
type database to support terminal functions. However, if you
accept the fact that escape sequences will not work in all
cases or the system does not have any type of terminal support
then you might have to use escape sequences.
> Ian, We use modula-2 here in Trinity and we too tried to find a way to clear t
he
> screen and return the cursor to the top of the
> screen. It apparently cannot be done. We use VT320 terminals and went to the c
om
> p. lab. to get the manuels for the terminals.
> Having got them we frantically searched through it to find some sort of escape
s
> equence or ascii character to do it.
> The result is that it cannot be done!!!
> However if you use VMS on a Vax then typing the following will do it for you..
.
> $ SET TERM/WIDTH=132
> $ SET TERM/WIDTH=80
I think the original poster wants to do this as part of a larger
program?? Invoking DCL from a program is very slow when compared
to directly calling a function.
> This then clears the screen and returns the cursor to the top of the screen. I
h
> ope that might be of some help.
> Cheers,
> John Grogan, Computer Lab., Trinity College Dublin.
There are terminal independent ways to clear the screen under
VAX/VMS. I do not know if your Modula-2 compiler has support to
call the VMS RTL functions. I do not have M-2 on our Vax so the
code below is in VMS Pascal and VMS C (VAX-11). The pascal
version seems to be faster, probably due to the difference in
making one function call instead of the 2 calls in the C version.
The C version uses the curses package so should work on any system
that has curses (some don't ???). maybe M-2 has something similiar
to C curses? The Pascal version depends on a VMS Run-Time Library
function so will not work on a non-VMS system. If you are running
M-2 on a VMS system you should be able to call the RTL functions
or get a new compilier:-).
Hope this gives you some leads on the problem.
Pascal version:
program clear(input,output);
type word_int = [word]0..65535;
var i:integer;
[external] function lib$erase_page
(line_no : word_int;
col_no : word_int): INTEGER;
EXTERNAL;
BEGIN
i := lib$erase_page(line_no:=1,col_no:=1);
END.
C version:
#include stdio
#include curses
main()
{
initscr();
endwin();
}
Good Luck.
///
Ray 'StarSailer' Howard /// #include <std.disclaimers>
Bitnet: c136erh@utarlg \\\ ///
Internet: c136erh@utarlg.arl.utexas.edu \\X//
UUCP: ...!{ames,sun,texbell,<vertebra>}!utarlg.arl.utexas.edu!c136erh
Technical Details
Message-ID:
<INFO-M2%89052312580588@UCF1VM>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!UTARLG.BITNET!C136ERHShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!UTARLG.BITNET!C136ERH From: C136ERH@UTARLG.BITNET (Ray Howard) Newsgroups: comp.lang.modula2 Subject: Re: beginner's stupid question Message-ID: <INFO-M2%89052312580588@UCF1VM> Date: 18 May 89 14:48:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Modula2 List <INFO-M2%UCF1VM.bitnet@jade.berkeley.edu> Organization: The Internet Lines: 100