From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,910b4871e877feea X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-18 10:51:17 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newshub.sdsu.edu!elnk-pas-nf2!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3EF0A687.1070004@spam.com> From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: help with Ada95 References: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 18 Jun 2003 17:51:18 GMT NNTP-Posting-Host: 63.184.9.29 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 1055958678 63.184.9.29 (Wed, 18 Jun 2003 10:51:18 PDT) NNTP-Posting-Date: Wed, 18 Jun 2003 10:51:18 PDT Xref: archiver1.google.com comp.lang.ada:39405 Date: 2003-06-18T17:51:18+00:00 List-Id: Cephus� wrote: > 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 "package Screen is" appears to be missing. > > 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 "package body Screen is" appears to be missing. > > 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; Other than those problems marked, which might be cut and paste errors rather than errors in the code, there does not appear to be anything wrong with it. It would help if you told us what error messages you were getting, or what makes you think there is something wrong with it. It also helps if you tell us what compiler and version you're using, and on what OS and version. -- Jeff Carter "You tiny-brained wipers of other people's bottoms!" Monty Python & the Holy Grail