comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: DOS Options
Date: Wed, 19 Dec 2007 16:59:25 -0600
Date: 2007-12-19T16:59:25-06:00	[thread overview]
Message-ID: <fkc7k9$2rf$1@jacob-sparre.dk> (raw)
In-Reply-To: 476973a3$1_5@news.bluewin.ch

"Gautier" <gautier@fakeaddress.nil> wrote in message
news:476973a3$1_5@news.bluewin.ch...
...
> Your 3.15p is certainly the Windows version, and what you are seeing is a
Win32
> console output. Indeed, you need to congratulate Microsoft which decided
to
> parse and separate the arguments in Win32 in a fashion consistent with
DOS -
> adding the parsing of filenames containing spaces, enclosed by "".
> Ada.Command_Line.Argument(i) just gives the "ith" argument from the
system, as
> the system wants to give it, that's it.

I have no idea what you are talking about. Both MS-DOS and Win32 only
provide a single string as the result of the command line -- the system
provides no parsing whatsoever. For Win32, the function is GetCommandLine.
In DOS, you had to grab the string from the memory of your executable
process -- there isn't even a function to get it.

Parsing is something that was provided by C compilers on both of those
platforms. The was generally defined to be compatible with the Unix C
implementations (since that is how C was originally defined). Janus/Ada
never did any parsing at all (just returning a single string, even on Unix);
if we had done some, it would have separated the options out as the original
OP suggested. But that would be fairly complex to do, we never figured out a
good way to encapsulate it for our products, so we didn't make that library
available to our customers.

I'm a little stunned that Turbo Pascal would have copied this useless
parsing definition, given that they had to write all of the code themselves.
But perhaps it is the same reason that we ended up doing so for
Ada.Command_Line: to be compatible with C compilers and/or (possible) Unix
versions of your product.

In any event, Microsoft's OSes have had nothing whatsoever to do the the
parsing of command lines.
All of the code to parse the command line appears inside of Ada.Command_Line
for a Windows implementation (or perhaps some lower-level library intended
to emulate Unix behavior).

                          Randy.





  reply	other threads:[~2007-12-19 22:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-05  3:34 DOS Options Charles H. Sampson
2007-12-05  5:15 ` Jeffrey Creem
2007-12-19 18:00   ` Charles H. Sampson
2007-12-19 19:40     ` Gautier
2007-12-19 22:59       ` Randy Brukardt [this message]
2007-12-19 23:36         ` Adam Beneschan
2007-12-20 22:15           ` Randy Brukardt
2007-12-19 22:47     ` Randy Brukardt
2007-12-19 22:47     ` Randy Brukardt
2007-12-21  0:39       ` Jeffrey R. Carter
2007-12-22  0:45         ` Randy Brukardt
2007-12-19 22:47     ` Randy Brukardt
2007-12-19 22:47     ` Randy Brukardt
2007-12-05 10:06 ` gautier_niouzes
2007-12-05 10:19 ` Stephen Leake
2007-12-05 14:51 ` Charles H. Sampson
2007-12-05 20:06 ` anon
replies disabled

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