comp.lang.ada
 help / color / mirror / Atom feed
* Re: functions, packages & characters
@ 2002-02-21  8:59 Christoph Grein
  2002-02-21 18:07 ` Unversed Angel
  0 siblings, 1 reply; 42+ messages in thread
From: Christoph Grein @ 2002-02-21  8:59 UTC (permalink / raw)


From the code you provided we can see that you are completely unfamiliar with 
Ada, this will never compile.

This is not an accusation, we all have been beginners some time :-) but please 
take an intoductory book about Ada (see AdaPower) and work thru it. There are so 
many problems in the code it's really no use to correct them all. You really 
have to get a basic understanding of Ada first.

Begin with a hello world program:

with Ada.Text_IO;

procedure Hello is
  procedure Say_Hello is
  begin
    Ada.Text_IO.Put_Line ("Hello Greenhorn :-)");
  end Say_Hello;
begin
  Say_Hello;
end Hello;


> I have been looking at my program and wondered if this woul work
> 
> package obtain is
>   function Get_Line;   <--- return type missing
> end obtain;
> 
> with Text_io;
> use Text_io;
> package body obtain is
> begin                             <--- remove this line (wrong here)
> function Get_Line (Text :String)  <--- body does not match specification
>        return Unbounded_String;   <--- replace ; by is begin
>   Get_Line;                       <--- Parameters missing
                                    <--- return stement missing
> end;                              <--- another end statement missing

etc....

> 
> With Text_IO;
> use Text_IO;
> with obtain
> procedure main is
>   ---
>   ---pre: tags are in the text
>   ---post:tags have been correctly reformatted
>   ---
>   Text: File;
> 
> function Find_Dblslash (//)
>          return Single Slash(/)procedure main is
> begin 
> Put_Line ("Please enter text: ");
> use obtain;



^ permalink raw reply	[flat|nested] 42+ messages in thread
* functions, packages & characters
@ 2002-02-21  0:16 Unversed Angel
  2002-02-21  0:37 ` tmoran
  0 siblings, 1 reply; 42+ messages in thread
From: Unversed Angel @ 2002-02-21  0:16 UTC (permalink / raw)


Hi, i am new to programming and am learning Ada.
I have been staring at the screen all day and don't know what to do.
I want to know if you can put a couple of functions through a procedure because
my compiler keeps stopping me, should i be using packages and how would i do
that?
Also i need to replace a // with one / in my program and can't find anything
similar in any books.
Any help would be useful.



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

end of thread, other threads:[~2002-03-05 14:36 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-21  8:59 functions, packages & characters Christoph Grein
2002-02-21 18:07 ` Unversed Angel
2002-02-21 18:28   ` Hyman Rosen
2002-02-21 23:44     ` Randy Brukardt
2002-02-22  0:37       ` Matthew Heaney
2002-02-22  1:12         ` Matthew Heaney
2002-02-22  2:57         ` Randy Brukardt
2002-02-22 13:54           ` Marin David Condic
2002-02-23  1:10             ` Matthew Heaney
2002-02-25 15:47               ` Marin David Condic
2002-02-26 15:58                 ` Matthew Heaney
2002-02-25 19:37             ` Randy Brukardt
2002-02-25 20:49               ` Marin David Condic
2002-02-26  3:30               ` David Starner
2002-02-26 15:44                 ` Hyman Rosen
2002-02-26 21:43                   ` David Starner
2002-02-27  6:32                     ` Hyman Rosen
2002-02-28  3:55                       ` Chad R. Meiners
2002-02-28 18:44                         ` Hyman Rosen
2002-03-02  3:25                           ` Chad R. Meiners
2002-03-03  8:22                             ` Hyman Rosen
2002-03-03 17:50                               ` Chad R. Meiners
2002-03-01  2:08                         ` David Starner
2002-03-05 14:36                       ` Marin David Condic
2002-02-26  7:42               ` tmoran
2002-02-22 15:34           ` Matthew Heaney
2002-02-22  2:47       ` Jeffrey Carter
2002-02-22 13:41       ` Marin David Condic
2002-02-23  1:08         ` Matthew Heaney
2002-02-23  2:03         ` Jeffrey Carter
2002-02-22 16:27       ` Hyman Rosen
2002-02-21 23:49     ` unversedangel
2002-02-21 22:48   ` unversedangel
2002-02-21 23:14     ` Hyman Rosen
2002-02-22 14:11     ` Marin David Condic
  -- strict thread matches above, loose matches on Subject: below --
2002-02-21  0:16 Unversed Angel
2002-02-21  0:37 ` tmoran
2002-02-21  1:13   ` Unversed Angel
2002-02-21  2:53     ` tmoran
2002-02-21  8:25       ` Unversed Angel
2002-02-21 13:47         ` Marin David Condic
2002-02-22  0:22         ` tmoran

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