comp.lang.ada
 help / color / mirror / Atom feed
* is this a mistake in the book or ...
@ 2014-09-10  8:26 gdotone
  2014-09-10  8:36 ` anon
  2014-09-10 15:02 ` Adam Beneschan
  0 siblings, 2 replies; 6+ messages in thread
From: gdotone @ 2014-09-10  8:26 UTC (permalink / raw)


The following coming from Ada 95 Problem Solving and Program
Design p.121

Program 3.8 Specification for Screen Package
----------------------------------------------------------------------

Package Screen is
----------------------------------------------------------------------
-- | Procedure for drawing pictures on ANSI Terminal Screen
-- | Author: Michael B. Feldman, The George Washington University
-- | Last Modified: July 1995
----------------------------------------------------------------------

   -- constants: the number of rows and columns on the terminal

   Screen_Depth : constant Integer := 24;
   Screen_Width : constant Integer := 80;

   -- subtypes giving the ranges of acceptable inputs
   -- to the cursor-positioning operation

   subtype Depth is Integer range 1..Screen_Depth;
   subtype Width is Integer range 1..Screen_Width;

   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 in-range value
   -- Post: Cursor is moved to the given spot on the screen

End Screen;

when i compile this using gnatmake -gnatl Screen.adb

i get an error message: >>> keyword "Body" expected here [see file name]
and a pointer to the location right after Package and before Screen

are package specification able to be compiled without the body?
and or how do i compile this?

in program 3.9 p 122 Body of Screen Package
i do see

PACKAGE BODY Screen is ...

so do they need to be compiled together?
if so, how do i do that?


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-09-11  1:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-10  8:26 is this a mistake in the book or gdotone
2014-09-10  8:36 ` anon
2014-09-10  8:53   ` gdotone
2014-09-10 15:02 ` Adam Beneschan
2014-09-10 15:49   ` Pascal Obry
2014-09-11  1:03   ` gdotone

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