comp.lang.ada
 help / color / mirror / Atom feed
* Help -- Command line arguments
@ 1996-09-18  0:00 Stephen M O'Shaughnessy
  1996-09-20  0:00 ` Ken Garlington
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Stephen M O'Shaughnessy @ 1996-09-18  0:00 UTC (permalink / raw)



Is there a way in Ada to pass commands from the command line
when a process is started?





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Help -- Command line arguments
  1996-09-18  0:00 Help -- Command line arguments Stephen M O'Shaughnessy
  1996-09-20  0:00 ` Ken Garlington
  1996-09-20  0:00 ` Ken Garlington
@ 1996-09-20  0:00 ` David Shochat
  1996-09-20  0:00 ` David Shochat
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: David Shochat @ 1996-09-20  0:00 UTC (permalink / raw)



Stephen M O'Shaughnessy wrote:
> 
> Is there a way in Ada to pass commands from the command line
> when a process is started?

Since you didn't say, I'll assume you're using Ada 95. In that case,
what you want is in package Ada.Command_Line. For Ada 83, the Standard
was silent on the subject, but most Ada 83 compilers came with
vendor-specific packages to do what you want. If you're not using Ada
95, you should say which compiler you are using (not to mention which
platform) and someone can then tell you what the package is called for
that vendor's version.
-- David




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Help -- Command line arguments
  1996-09-18  0:00 Help -- Command line arguments Stephen M O'Shaughnessy
  1996-09-20  0:00 ` Ken Garlington
@ 1996-09-20  0:00 ` Ken Garlington
  1996-09-20  0:00 ` David Shochat
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Ken Garlington @ 1996-09-20  0:00 UTC (permalink / raw)



Stephen M O'Shaughnessy wrote:
> 
> Is there a way in Ada to pass commands from the command line
> when a process is started?

There's a standard way in Ada 95 (Ada.Command_Line, I believe) and
various non-standard ways in Ada 83.

-- 
LMTAS - "Our Brand Means Quality"




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Help -- Command line arguments
  1996-09-18  0:00 Help -- Command line arguments Stephen M O'Shaughnessy
                   ` (2 preceding siblings ...)
  1996-09-20  0:00 ` David Shochat
@ 1996-09-20  0:00 ` David Shochat
  1996-09-21  0:00 ` Calius
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: David Shochat @ 1996-09-20  0:00 UTC (permalink / raw)



Reposting article removed by rogue canceller.

Stephen M O'Shaughnessy wrote:
> 
> Is there a way in Ada to pass commands from the command line
> when a process is started?

Since you didn't say, I'll assume you're using Ada 95. In that case,
what you want is in package Ada.Command_Line. For Ada 83, the Standard
was silent on the subject, but most Ada 83 compilers came with
vendor-specific packages to do what you want. If you're not using Ada
95, you should say which compiler you are using (not to mention which
platform) and someone can then tell you what the package is called for
that vendor's version.
-- David




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Help -- Command line arguments
  1996-09-18  0:00 Help -- Command line arguments Stephen M O'Shaughnessy
@ 1996-09-20  0:00 ` Ken Garlington
  1996-09-20  0:00 ` Ken Garlington
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Ken Garlington @ 1996-09-20  0:00 UTC (permalink / raw)



Reposting article removed by rogue canceller.

Stephen M O'Shaughnessy wrote:
> 
> Is there a way in Ada to pass commands from the command line
> when a process is started?

There's a standard way in Ada 95 (Ada.Command_Line, I believe) and
various non-standard ways in Ada 83.

-- 
LMTAS - "Our Brand Means Quality"




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Help -- Command line arguments
  1996-09-18  0:00 Help -- Command line arguments Stephen M O'Shaughnessy
                   ` (4 preceding siblings ...)
  1996-09-21  0:00 ` Calius
@ 1996-09-21  0:00 ` Calius
  1996-09-21  0:00   ` David C. Hoos, Sr.
  1996-09-21  0:00   ` David C. Hoos, Sr.
  1996-09-23  0:00 ` Jon S Anthony
  6 siblings, 2 replies; 10+ messages in thread
From: Calius @ 1996-09-21  0:00 UTC (permalink / raw)



Stephen M O'Shaughnessy wrote:
> 
> Is there a way in Ada to pass commands from the command line
> when a process is started?

Actually, on my specific implementation (Verdix SELF on AIX), there is.
There's a demo program supplied with the compiler to do that, but
basically what
it does is declare ArgV and ArgC as PRAGMA INTERFACE variables, and the
startup
module (which is written in C and linked to the application) actually
declares and
allocates them, and initiailzed them.

The way the are used is like in C, ofcourse.

If you're not using SELF, check your example directory.

                      Best of luck,
                                      Calius




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Help -- Command line arguments
  1996-09-21  0:00 ` Calius
  1996-09-21  0:00   ` David C. Hoos, Sr.
@ 1996-09-21  0:00   ` David C. Hoos, Sr.
  1 sibling, 0 replies; 10+ messages in thread
From: David C. Hoos, Sr. @ 1996-09-21  0:00 UTC (permalink / raw)



> Stephen M O'Shaughnessy wrote:
> > 
> > Is there a way in Ada to pass commands from the command line
> > when a process is started?
You can see an example in my post  Re: Recommended way of reading file as
byte blocks
Hope this helps.
-- 
David C. Hoos, Sr.,
http://www.dbhwww.com
http://www.ada95.com





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Help -- Command line arguments
  1996-09-21  0:00 ` Calius
@ 1996-09-21  0:00   ` David C. Hoos, Sr.
  1996-09-21  0:00   ` David C. Hoos, Sr.
  1 sibling, 0 replies; 10+ messages in thread
From: David C. Hoos, Sr. @ 1996-09-21  0:00 UTC (permalink / raw)



Reposting article removed by rogue canceller.

> Stephen M O'Shaughnessy wrote:
> > 
> > Is there a way in Ada to pass commands from the command line
> > when a process is started?
You can see an example in my post  Re: Recommended way of reading file as
byte blocks
Hope this helps.
-- 
David C. Hoos, Sr.,
http://www.dbhwww.com
http://www.ada95.com





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Help -- Command line arguments
  1996-09-18  0:00 Help -- Command line arguments Stephen M O'Shaughnessy
                   ` (3 preceding siblings ...)
  1996-09-20  0:00 ` David Shochat
@ 1996-09-21  0:00 ` Calius
  1996-09-21  0:00 ` Calius
  1996-09-23  0:00 ` Jon S Anthony
  6 siblings, 0 replies; 10+ messages in thread
From: Calius @ 1996-09-21  0:00 UTC (permalink / raw)



Reposting article removed by rogue canceller.

Stephen M O'Shaughnessy wrote:
> 
> Is there a way in Ada to pass commands from the command line
> when a process is started?

Actually, on my specific implementation (Verdix SELF on AIX), there is.
There's a demo program supplied with the compiler to do that, but
basically what
it does is declare ArgV and ArgC as PRAGMA INTERFACE variables, and the
startup
module (which is written in C and linked to the application) actually
declares and
allocates them, and initiailzed them.

The way the are used is like in C, ofcourse.

If you're not using SELF, check your example directory.

                      Best of luck,
                                      Calius




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Help -- Command line arguments
  1996-09-18  0:00 Help -- Command line arguments Stephen M O'Shaughnessy
                   ` (5 preceding siblings ...)
  1996-09-21  0:00 ` Calius
@ 1996-09-23  0:00 ` Jon S Anthony
  6 siblings, 0 replies; 10+ messages in thread
From: Jon S Anthony @ 1996-09-23  0:00 UTC (permalink / raw)



In article <Dxy28C.7wB@most.fw.hac.com> smosha@most.fw.hac.com (Stephen M O'Shaughnessy) writes:

> Is there a way in Ada to pass commands from the command line
> when a process is started?

See Ada.Command_Line ARM A.15

For example,

with Ada.Command_Line;  use Ada.Command_Line;
with Text_Io;  use Text_Io;
 
procedure X is
 
begin
    Put_Line(
        "My name is " & Command_Name & ", I have" &
        Integer'Image(Argument_Count) & " arguments.");
    Put_Line("They are: ");
    for I in 1..Argument_Count loop
        Put_Line("  " & Argument(I));
    end loop;
end;

$ gnatmake x.adb
$ x 1 2 3
My name is x, I have 3 arguments.
They are: 
  1
  2
  3
$

/Jon
-- 
Jon Anthony
Organon Motives, Inc.
1 Williston Road, Suite 4
Belmont, MA 02178

617.484.3383
jsa@organon.com





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~1996-09-23  0:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-09-18  0:00 Help -- Command line arguments Stephen M O'Shaughnessy
1996-09-20  0:00 ` Ken Garlington
1996-09-20  0:00 ` Ken Garlington
1996-09-20  0:00 ` David Shochat
1996-09-20  0:00 ` David Shochat
1996-09-21  0:00 ` Calius
1996-09-21  0:00 ` Calius
1996-09-21  0:00   ` David C. Hoos, Sr.
1996-09-21  0:00   ` David C. Hoos, Sr.
1996-09-23  0:00 ` Jon S Anthony

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