comp.lang.ada
 help / color / mirror / Atom feed
From: anon@att.net
Subject: Re: is this a mistake in the book or ...
Date: Wed, 10 Sep 2014 08:36:01 +0000 (UTC)
Date: 2014-09-10T08:36:01+00:00	[thread overview]
Message-ID: <lup2hg$cv7$1@speranza.aioe.org> (raw)
In-Reply-To: f169bcf2-5558-4e2e-acf5-7bf887a1032c@googlegroups.com

Since your using GNAT compiler 

  Specification files must have extension ".ads"
  while the body is extension ".adb"

  
In <f169bcf2-5558-4e2e-acf5-7bf887a1032c@googlegroups.com>, gdotone@gmail.com writes:
>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?



  reply	other threads:[~2014-09-10  8:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-10  8:26 is this a mistake in the book or gdotone
2014-09-10  8:36 ` anon [this message]
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
replies disabled

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