comp.lang.ada
 help / color / mirror / Atom feed
From: "Cephus�" <beau@hiwaay.net>
Subject: help with Ada95
Date: Tue, 17 Jun 2003 22:47:45 -0500
Date: 2003-06-17T22:47:45-05:00	[thread overview]
Message-ID: <vevo6o7bobse67@corp.supernews.com> (raw)

Hey guys I have this book: Ada 95 3rd edition (gold (maybe yellow in color)
Problem Solving and Program Design by Feldman and Koffman.

They provide all of their code from the book examples and I am trying to use
a package of theirs dealing with the screen... here is the package spec and
body. Please tell me what is wrong with it...

Screen.ads:
-- constants; the number of rows and columns on the terminal

ScreenDepth : CONSTANT Integer := 24;

ScreenWidth : CONSTANT Integer := 80;

-- subtypes giving the ranges of acceptable inputs

-- to the cursor-positioning operation

SUBTYPE Depth IS Integer RANGE 1..ScreenDepth;

SUBTYPE Width IS Integer RANGE 1..ScreenWidth;

PROCEDURE Beep;

-- Pre: None

-- Post: Terminal makes its beep sound once

PROCEDURE ClearScreen;

-- Pre: None

-- Post: Terminal Screen is cleared

PROCEDURE MoveCursor (Column : Width; Row : Depth);

-- Pre: Column and Row have been assigned values

-- Post: Cursor is moved to the given spot on the screen

END Screen;

----------------------------------------------------------------------------
-----------------

Screen.adb

PROCEDURE Beep IS

BEGIN

Ada.Text_IO.Put (Item => Ada.Characters.Latin_1.BEL);

Ada.Text_IO.Flush;

END Beep;

PROCEDURE ClearScreen IS

BEGIN

-- Ada.Text_IO.Put (Item => Ada.Characters.Latin_1.ESC);

-- Ada.Text_IO.Put (Item => "[2J");

-- Ada.Text_IO.Flush;

Ada.TEXT_IO.New_Line(Spacing => 35);

MoveCursor(Row => 1, Column => 1);

END ClearScreen;

PROCEDURE MoveCursor (Column : Width; Row : Depth) IS

BEGIN

Ada.Text_IO.Flush;

Ada.Text_IO.Put (Item => Ada.Characters.Latin_1.ESC);

Ada.Text_IO.Put ("[");

Ada.Integer_Text_IO.Put (Item => Row, Width => 1);

Ada.Text_IO.Put (Item => ';');

Ada.Integer_Text_IO.Put (Item => Column, Width => 1);

Ada.Text_IO.Put (Item => 'f');

END MoveCursor;

END Screen;



sorry for the text, I just copied it straight from the compiler



Beau





             reply	other threads:[~2003-06-18  3:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-18  3:47 Cephus� [this message]
2003-06-18  5:27 ` help with Ada95 Fionn mac Cuimhaill
2003-06-18 16:41   ` Frank Piron
2003-06-18 16:48     ` Frank Piron
2003-06-18 22:24     ` Jerry van Dijk
2003-06-18 17:51 ` Jeffrey Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox