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: 103376,782af4edeb84c4b7 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.karotte.org!news2.arglkargh.de!noris.net!news.teledata-fn.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: basic basic ada question From: Georg Bauhaus In-Reply-To: <1161268231.345231.242170@m73g2000cwd.googlegroups.com> References: <1161268231.345231.242170@m73g2000cwd.googlegroups.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: # Message-ID: <1161269257.24061.25.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Date: Thu, 19 Oct 2006 16:47:37 +0200 NNTP-Posting-Date: 19 Oct 2006 16:45:28 CEST NNTP-Posting-Host: 7dc95abd.newsspool4.arcor-online.net X-Trace: DXC=?Ha?[9h<>K8TQL:hoD@>T?4IUKCkJ31`kAE[2>?5R4 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:7042 Date: 2006-10-19T16:45:28+02:00 List-Id: 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 ...; ...