Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VT 100 screen control

0 views
Skip to first unread message

Lige F. Hensley

unread,
Jan 17, 1994, 10:28:51 PM1/17/94
to
How do you control the cursor on a VT100 terminal from ADA? Like change
color, move around, reverse video, etc...
----------------------------------------------------------------------------
Slam Foot Neck! Copyright 1994, All Rights Reserved
Batteries not included. Ride the wave. Touch Touch Touch. I'm cereal.
(aka Computer Engineer, mega-miler, sleepy person)
FIDOnet: Lige Hensley@1:231/550 (3176409759)
Internet: HENS...@NEXTWORK.ROSE-HULMAN.EDU
USPS: What's that?
o__ o__ o__ o__ o__
,>/'_ ,>/'_ ,>/'_ ,>/'_ ,>/'_
(_)\(_) (_)\(_) (_)\(_) (_)\(_) (_)\(_)
----------------------------------------------------------------------------

Michael Feldman

unread,
Jan 18, 1994, 12:31:31 PM1/18/94
to
In article <henslelf.7...@nextwork.rose-hulman.edu>,

Lige F. Hensley <hens...@nextwork.rose-hulman.edu> wrote:
>How do you control the cursor on a VT100 terminal from ADA? Like change
>color, move around, reverse video, etc...
>----------------------------------------------------------------------------
See code below for a start. Just add the procedures you need.

Mike Feldman

------------------------------------------------------------------------
Michael B. Feldman - chair, SIGAda Education Working Group
Professor, Dept. of Electrical Engineering and Computer Science
The George Washington University - Washington, DC 20052 USA
202-994-5253 (voice) - 202-994-0227 (fax) - mfel...@seas.gwu.edu (Internet)
"Pork is all that stuff the government gives the other guys."
------------------------------------------------------------------------
--- cut here ---

PACKAGE Screen IS

-- Procedures for drawing pictures on ANSI Terminal Screen

ScreenHeight : CONSTANT Integer := 24;
ScreenWidth : CONSTANT Integer := 80;

SUBTYPE Height IS Integer RANGE 1..ScreenHeight;
SUBTYPE Width IS Integer RANGE 1..ScreenWidth;

TYPE Position IS RECORD
Row : Height := 1;
Column: Width := 1;
END RECORD;

PROCEDURE Beep;
-- Pre: none
-- Post: the terminal beeps once

PROCEDURE ClearScreen;
-- Pre: none
-- Post: the terminal screen is cleared

PROCEDURE MoveCursor (To: IN Position);
-- Pre: To is defined
-- Post: the terminal cursor is moved to the given position

END Screen;

-------

WITH Text_IO;
WITH My_Int_IO;
PACKAGE BODY Screen IS

-- Procedures for drawing pictures on ANSI Terminal Screen
-- These procedures will work correctly only if the actual
-- terminal is ANSI compatible. ANSI.SYS on a DOS machine
-- will suffice.

PROCEDURE Beep IS
BEGIN
Text_IO.Put (Item => ASCII.BEL);
END Beep;

PROCEDURE ClearScreen IS
BEGIN
Text_IO.Put (Item => ASCII.ESC);
Text_IO.Put (Item => "[2J");
END ClearScreen;

PROCEDURE MoveCursor (To: IN Position) IS
BEGIN
Text_IO.New_Line;
Text_IO.Put (Item => ASCII.ESC);
Text_IO.Put ("[");
My_Int_IO.Put (Item => To.Row, Width => 1);
Text_IO.Put (Item => ';');
My_Int_IO.Put (Item => To.Column, Width => 1);
Text_IO.Put (Item => 'f');
END MoveCursor;

END Screen;

0 new messages