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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,782af4edeb84c4b7 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!e3g2000cwe.googlegroups.com!not-for-mail From: "markww" Newsgroups: comp.lang.ada Subject: Re: basic basic ada question Date: 19 Oct 2006 08:10:48 -0700 Organization: http://groups.google.com Message-ID: <1161270648.630817.73500@e3g2000cwe.googlegroups.com> References: <1161268231.345231.242170@m73g2000cwd.googlegroups.com> <1161269257.24061.25.camel@localhost.localdomain> NNTP-Posting-Host: 67.154.89.221 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1161270654 4698 127.0.0.1 (19 Oct 2006 15:10:54 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 19 Oct 2006 15:10:54 +0000 (UTC) In-Reply-To: <1161269257.24061.25.camel@localhost.localdomain> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: e3g2000cwe.googlegroups.com; posting-host=67.154.89.221; posting-account=cNKOMg0AAADT2ug8oGSYYXo8bsDvrHzw Xref: g2news2.google.com comp.lang.ada:7044 Date: 2006-10-19T08:10:48-07:00 List-Id: Hi Georg, 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? -- Where does Argument (0...numArgs) come from? end DynamicArray; Thanks, Mark On Oct 19, 10:47 am, Georg Bauhaus wrote: > On Thu, 2006-10-19 at 07:30 -0700, markww wrote: > > Hi, > > > Can someone give me an example of a command line app where I can read > > in command line arguments? > > > In C++ we have: > > > int main(int argc, char **argv) > > { > > printf("There are [%i] arguments.\n", argc); > > return 0; > > }This is from Ada's standard library: > > package Ada.Command_Line is > > 4 function Argument_Count return Natural; > > 5 function Argument (Number : in Positive) return String; > > Once you have read the number of desired array components > from the command line into, say, the constant Num_Components, > declare a corresponding array type, > > ... > type Your_Name_Here is array (? .. Num_Components) of ...; > ...