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-Thread: a07f3367d7,3084df62f3637626,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: George Newsgroups: comp.lang.ada Subject: Wrong program structure Date: 23 Oct 2010 21:08:32 GMT Message-ID: <8ih16gF70rU2@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net DmrcZZu7KhGma6+HlfxYlAg8FpRaiSquoqZInW8WUuXQ/9+sVj Cancel-Lock: sha1:LWsiR3v/qAuRvHYyBWMVnUzI+h4= User-Agent: Pan/0.132 (Waxed in Black) Xref: g2news1.google.com comp.lang.ada:14704 Date: 2010-10-23T21:08:32+00:00 List-Id: Hi All, GNAT is complaining about "begin" being used as identifier and a missing "begin" for procedure "keywords4". The progam structure is like this: with Ada.Text_IO; with Ada.Command_Line; with Ada.Characters.Handling; procedure keywords4 is procedure Ada83 is begin -- some string output end Ada83; procedure Ada95 is begin -- some string output end Ada95; procedure Ada2005 is begin -- some string output end Ada2005; procedure Attributes is begin -- some string output end Attributes; procedure Sources is begin -- some string output end Sources; procedure Author is begin -- some string output end Author; begin -- Ada.Command_Line.Argument_Count is "0" if -- a) Command_Line.Argument_Count is not implemented (Compiler, OS) -- b) no arguments given if Ada.Command_Line.Argument_Count > 0 then for counter in 1..Ada.Command_Line.Argument_Count loop declare Arg : constant String := Ada.Characters.Handling.To_Upper (Ada.Command_Line.Argument(counter)); -- some commands end loop; else -- if Argument_Count = 0 print help -- some commands end if; end keywords4; I nested the procedures Ada83, Ada95, etc. into keywords4 because I can not have multiple compilation units. I tried defining a package but when executing the program the runtime library came back with the message that the code could not be executed. Maybe I am asking simple questions. Its because I am new to Ada and try get used to the language. What is the problem with the above code? Regards George