comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: basic basic ada question
Date: Sat, 21 Oct 2006 06:29:26 -0400
Date: 2006-10-21T06:29:26-04:00	[thread overview]
Message-ID: <ud58mufll.fsf@stephe-leake.org> (raw)
In-Reply-To: 1161270648.630817.73500@e3g2000cwe.googlegroups.com

"markww" <markww@gmail.com> writes:

> Thanks for your response. I just don't understand how to implement it.
> In ada we have a function definition like:
>
> procedure DynamicArray is
> begin
>
>     -- Function body stuff here...
>     -- Where does Argument_Count come from?

The same place argc does in C.

>     
>     -- Where does Argument (0...numArgs) come from?

The same place argv does in C. Except Argument is a function, not an array.

> end DynamicArray;

I think you are missing how packages work in Ada; you need to go back
to your textbook.

Here's a working example:


with Ada.Command_Line;
with Ada.Text_IO;
procedure Demo is
begin
   Ada.Text_IO.Put_Line 
    ("Command line args: " & Integer'Image (Ada.Command_Line.Argument_Count));
   Ada.Text_IO.Put_Line 
    ("First        arg : '" & Ada.Command_Line.Argument (1) & "'");
end;

./demo.exe foo bar
Command line args:  2
First        arg : 'foo'

-- 
-- Stephe



  reply	other threads:[~2006-10-21 10:29 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-19 14:30 basic basic ada question markww
2006-10-19 14:47 ` Georg Bauhaus
2006-10-19 15:10   ` markww
2006-10-21 10:29     ` Stephen Leake [this message]
2006-10-19 15:11 ` Dmitry A. Kazakov
2006-10-19 15:45   ` markww
2006-10-19 16:29     ` Gautier
2006-10-19 17:16     ` Dmitry A. Kazakov
2006-10-19 20:07     ` Jeffrey R. Carter
2006-10-19 22:20       ` Robert A Duff
2006-10-20  5:10         ` Jeffrey R. Carter
2006-10-20  7:13           ` Maciej Sobczak
2006-10-20 20:39             ` Jeffrey R. Carter
2006-10-20  7:25       ` Maciej Sobczak
2006-10-20 20:54         ` Jeffrey R. Carter
2006-10-19 21:30 ` James Alan Farrell
2006-10-19 23:03   ` Robert A Duff
2006-10-20  4:54   ` Jeffrey R. Carter
2006-10-20  7:53   ` Dmitry A. Kazakov
2006-10-20  8:17     ` Maciej Sobczak
2006-10-20  9:08       ` Dmitry A. Kazakov
2006-10-20 11:15         ` Maciej Sobczak
2006-10-20 12:19           ` Dmitry A. Kazakov
2006-10-20 12:38             ` Maciej Sobczak
2006-10-20 13:26               ` Dmitry A. Kazakov
2006-10-20 15:29             ` Robert A Duff
2006-10-20 17:37               ` Dmitry A. Kazakov
2006-10-20 20:59                 ` Robert A Duff
2006-10-21 13:39                   ` Dmitry A. Kazakov
2006-10-21 17:53                     ` Robert A Duff
2006-10-22  8:45                       ` Dmitry A. Kazakov
2006-10-23  7:45                     ` Maciej Sobczak
2006-10-23  9:21                       ` Dmitry A. Kazakov
2006-10-23 14:30                         ` Maciej Sobczak
2006-10-23 15:08                           ` Dmitry A. Kazakov
2006-10-23 15:49                             ` Robert A Duff
2006-10-24  7:34                               ` Dmitry A. Kazakov
2006-10-20 19:04           ` Simon Wright
2006-10-20 15:27         ` Robert A Duff
2006-10-20 17:37           ` Dmitry A. Kazakov
2006-10-20 21:00     ` Jeffrey R. Carter
2006-10-21  8:19       ` Dmitry A. Kazakov
2006-10-21 17:32         ` Robert A Duff
2006-10-22  8:45           ` Dmitry A. Kazakov
2006-10-30 11:46             ` Martin Krischik
replies disabled

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