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,6e64435d2a7280f2 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!not-for-mail From: John McCabe Newsgroups: comp.lang.ada Subject: Re: Ada.Command_Line.Argument_Count question Date: Fri, 18 Sep 2009 16:03:43 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <4ab00009$0$282$14726298@news.sunsite.dk> <2191b7e4-c09d-42fe-b446-1ca01e44c1ba@b18g2000vbl.googlegroups.com> NNTP-Posting-Host: RXEkuaSUwmKe0XIGFYSK7A.user.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.0 X-Newsreader: Forte Agent 2.0/32.652 Cancel-Lock: sha1:Io3TghHNZS7bcfIgJKKYA74lzDw= Xref: g2news2.google.com comp.lang.ada:8383 Date: 2009-09-18T16:03:43+01:00 List-Id: On Thu, 17 Sep 2009 22:12:17 -0700 (PDT), sjw wrote: >On Sep 17, 2:50�pm, John McCabe wrote: > >> For example if, on the command line, I type: >> >> prog1.exe a b c >> >> Does Argument_Count() return 3 or 4? I haven't looked at this >> paragraph in detail, or what surrounds it, but "the number of >> arguments passed to the program invoking the function" sounds a bit >> vague. Is the "program invoking the function" the shell, or the >> program you're running? > >3. >The program you're running. For all implementations? I see that Ada.Command_Line.Command_Name returns the name of the program that's been run. On Gnat at least it all makes sense. Compared to C++ (MSVC) on Win32 for: printargs.exe 1 2 3 I get.. Ada C++ Argument Count 3 4 command name printargs.exe equiv. to argv[0] argument 1 1 1 argument 2 2 2 argument 3 3 3 I guess, from the Annotated ARM, section A.15(22) & A.15(22a).