comp.lang.ada
 help / color / mirror / Atom feed
* Command line arguments
  1991-04-25 14:37 ` Ralph Reid III
@ 1991-04-29 22:16   ` Erland Sommarskog
  1991-04-30  5:40     ` rharwood
  1991-04-30 13:57     ` Steve Gabrilowitz
  0 siblings, 2 replies; 18+ messages in thread
From: Erland Sommarskog @ 1991-04-29 22:16 UTC (permalink / raw)


Also sprach Ralph Reid III (rreid@ecst.csuchico.edu):
>I have played around with command line parameters in Ada a little,
>and there does not seem to be a standard technique for reading them.
>Several pieces of source code seem to be floating around, and two
>examples came with the Meridian Adavantage compiler I have.  Perhaps
>a standard should be considered for Ada9x?

Undoubtedly it would be pleasant if all Ada compilers on
Unix were interchangeable on argv/argc, but that something
like a POSIX binding not Ada 9X.

Since you retrieve the arguments differently in different OSs,
reading the command line is something which by definition is
not portable(*) so it can't be in the language. Remember that 
the command-line interface itself is OS dependent.

(*) Yes, I know that argc/argv is commonly available with C
implementations. But if you're going to get the command-line
interface right in, say, VMS, you better use the CLI$ routines.
-- 
Erland Sommarskog - ENEA Data, Stockholm - sommar@enea.se
Le fils du maire est en Normandie avec beaucoup de medecins.

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

* Re: Command line arguments
  1991-04-29 22:16   ` Command line arguments Erland Sommarskog
@ 1991-04-30  5:40     ` rharwood
  1991-04-30 13:57     ` Steve Gabrilowitz
  1 sibling, 0 replies; 18+ messages in thread
From: rharwood @ 1991-04-30  5:40 UTC (permalink / raw)


In article <3275@enea.se>, sommar@enea.se (Erland Sommarskog) writes:
> Undoubtedly it would be pleasant if all Ada compilers on
> Unix were interchangeable on argv/argc, but that something
> like a POSIX binding not Ada 9X.
> 
> Since you retrieve the arguments differently in different OSs,
> reading the command line is something which by definition is
> not portable(*) so it can't be in the language. Remember that 
> the command-line interface itself is OS dependent.
> 
> (*) Yes, I know that argc/argv is commonly available with C
> implementations. But if you're going to get the command-line
> interface right in, say, VMS, you better use the CLI$ routines.

Erland, I agree 100%.  Here's perhaps some more "justification".

Perhaps the "correct" way for portability would be to write a package for EACH
PROGRAM (or system) that has functions which return the possible values of
switches and other command line "entries", like the following parameters for a
PC-based file DUMP routine I recently wrote:

  type bases is (hex, ascii, octal);
  function address_format return bases;
  function file_to_dump return string;

Then your "main" routine calls these functions, no matter what the external
environment is.  NOW comes the "non-portable" interface, where the actual
BODIES of those functions above must call the OS-specific routines to determine
the command line arguments.  It would conceptually be possible to write two
external interface routines:

(1) one which works under the "unit test" mode and runs on the "host" system
such as the VAX or PC-compatible

(2) another which runs only on the target hardware, perhaps an embedded 80186
or 1750A machine.

Ada is NOT the first language where information hiding has advantages...  We
must THINK in terms of portability and encapsulation during DESIGN. At CODE
time is too late!  <"plop-plop"... stepping of off soap box>

Ray
-----
Ray Harwood           |Data Basix           |Associate Faculty,    
Voice: (602)721-1988  |PO Box 18324         |   Pima Community College
FAX:   (602)721-7240  |Tucson, AZ 85731     |Instructor in Ada and Pascal
CompuServe: 76645,1370|AppleLink: DATA.BASIX|Internet: rharwood@east.pima.edu

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

* Re: Command line arguments
  1991-04-29 22:16   ` Command line arguments Erland Sommarskog
  1991-04-30  5:40     ` rharwood
@ 1991-04-30 13:57     ` Steve Gabrilowitz
  1991-05-01 23:57       ` Charles H. Sampson
  1 sibling, 1 reply; 18+ messages in thread
From: Steve Gabrilowitz @ 1991-04-30 13:57 UTC (permalink / raw)


In article <3275@enea.se>, sommar@enea.se (Erland Sommarskog) writes:

|> 
|> Since you retrieve the arguments differently in different OSs,
|> reading the command line is something which by definition is
|> not portable(*) so it can't be in the language. Remember that 
|> the command-line interface itself is OS dependent.
|> 
|> (*) Yes, I know that argc/argv is commonly available with C
|> implementations. But if you're going to get the command-line
|> interface right in, say, VMS, you better use the CLI$ routines.

Not exactly true.  The argc/argv will work fine under VMS without using the CLI$ routines if the program is invoked via a symbol:

$ TESTP :== $SYS$USER:[STEVE]TESTP.EXE
$ TESTP 1 2 3

Your statement is correct only if the program is installed as a command using a .CLD file and $ SET COMMAND and all that junk.

No matter, if Ada had some construct defined as a part of the language which would retrieve the commmand line parameters nothing would prevent the compiler writers from implementing whatever it was on VMS by internally calling the appropriate CLI$ functions - and isn't that part of what Ada is all about, providing a programming environment which is uniform and consistent over different platforms? 

The only problem I see with putting access to the command line into the Ada language is how it would be handled on embedded real time systems where the OS doesn't provide any mechanism for getting at the command line - indeed, there isn't even a command line to get at ;-)

Perhaps this could best be handled by providing a recommended "standard" for getting the command line in Chapter 13?

-- 




                            Steve Gabrilowitz
                            Martin Marietta, Orlando Fl.
                            sag@iplmail.orl.mmc.com
                            Fidonet 1:363/1701

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

* Re: Command line arguments
  1991-04-30 13:57     ` Steve Gabrilowitz
@ 1991-05-01 23:57       ` Charles H. Sampson
  1991-05-02 11:20         ` Joe Orost
  0 siblings, 1 reply; 18+ messages in thread
From: Charles H. Sampson @ 1991-05-01 23:57 UTC (permalink / raw)


In article <1991Apr30.135735.1211@iplmail.orl.mmc.com> sag@iplmail.orl.mmc.com (Steve Gabrilowitz) writes:
>       ... if Ada had some construct defined as a part of the language
>which would retrieve the commmand line parameters nothing would prevent
>the compiler writers from implementing whatever it was on VMS by internally
>calling the appropriate CLI$ functions - and isn't that part of what Ada
>is all about, providing a programming environment which is uniform and
>consistent over different platforms? 
>
>The only problem I see with putting access to the command line into the
>Ada language is how it would be handled on embedded real time systems where
>the OS doesn't provide any mechanism for getting at the command line -
>indeed, there isn't even a command line to get at ;-)
>
>Perhaps this could best be handled by providing a recommended "standard"
>for getting the command line in Chapter 13?

     This issue was discussed a few months ago and I'll repeat the same
point I tried to make then.  Suppose there were a standard Ada technique
for accessing command line parameters.  What would it gain you?  You
could get at the parameters, but they would be different on different
operating systems, so the code to process those parameters would not be
transportable.

     In saying this I assume that you want the parameters in the VMS
version of your program to be VMS-like, and in the UNIX version to be
UNIX-like.  If this assumption is wrong we can argue about it, but the
issue is then user interface, not Ada.

     I've now directed the implementation of several small multi-platform
programs written in Ada and the approach that I've used is one suggested
by another responder: The information obtained from the command line
parameters is abstracted in a package specification; that package's body
is rewritten for each environment.  One of these programs was ported to
an environment that does not have command line parameters and the package
body in this case implemented a set of hierarchical menus to obtain the
required information.

                             Charlie

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

* Re: Command line arguments
  1991-05-01 23:57       ` Charles H. Sampson
@ 1991-05-02 11:20         ` Joe Orost
  1991-05-06 21:56           ` Erland Sommarskog
  0 siblings, 1 reply; 18+ messages in thread
From: Joe Orost @ 1991-05-02 11:20 UTC (permalink / raw)


In article <3034@cod.NOSC.MIL> sampson@cod.NOSC.MIL (Charles H. Sampson) writes:
>                             Suppose there were a standard Ada technique
>for accessing command line parameters.  What would it gain you?  You
>could get at the parameters, but they would be different on different
>operating systems, so the code to process those parameters would not be
>transportable.
>
>     In saying this I assume that you want the parameters in the VMS
>version of your program to be VMS-like, and in the UNIX version to be
>UNIX-like.  If this assumption is wrong we can argue about it, but the
>issue is then user interface, not Ada.

The C language forces the UNIX style of command arguments onto different 
systems, and in doing so, has achieved a certain level of portability.

Why can't the Ada language do the same thing (or even follow C's lead
and also specify the UNIX conventions)?  [In fact, POSIX/Ada provides this.]

Aren't all future operating systems UNIX based, anyway :-) ?

				regards,
				joe

--

 Full-Name:  Joseph M. Orost
 Email:	     joeo@tinton.ccur.com
 Phone:      (908) 758-7284         Fax: (908) 758-7113
 US Mail:    MS 322; Concurrent Computer Corporation; 106 Apple St
             Tinton Falls, NJ 07724

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

* Re: Command line arguments
  1991-05-02 11:20         ` Joe Orost
@ 1991-05-06 21:56           ` Erland Sommarskog
  0 siblings, 0 replies; 18+ messages in thread
From: Erland Sommarskog @ 1991-05-06 21:56 UTC (permalink / raw)


Also sprach Steve Gabrilowitz (sag@iplmail.orl.mmc.com):
)I said:
)|) (*) Yes, I know that argc/argv is commonly available with C
)|) implementations. But if you're going to get the command-line
)|) interface right in, say, VMS, you better use the CLI$ routines.
)
)Not exactly true.  The argc/argv will work fine under VMS without using the
)CLI$ routines if the program is invoked via a symbol:
)
)$ TESTP :== $SYS$USER:[STEVE]TESTP.EXE
)$ TESTP 1 2 3

And then Joe Orost (joeo@masscomp.westford.ccur.com) raised his voice:
)The C language forces the UNIX style of command arguments onto different
)systems, and in doing so, has achieved a certain level of portability.
)
)Why can't the Ada language do the same thing (or even follow C's lead
)and also specify the UNIX conventions)?  [In fact, POSIX/Ada provides this.]

This isn't really an Ada issue, so be careful when/if you followup.

As a person living with Unix as a your every-day world, would you
fancy a facility with options like /[NO]QUALIFIER=KEYWORD?

Give me an VMS utility where I'm supposed to give qualifiers as -d2,
and if looks could kill you would be a dead man.

Portability is a virtue but user-friendliness and conformance to
the environment conformance are higher virtues.

That's why you should not use argv/argc on VMS (unless you really
want do CDU parsing on your own), but use the CLI$ routines instead.
-- 
Erland Sommarskog - ENEA Data, Stockholm - sommar@enea.se
WORLD CHAMPIONS IN ICE HOCKEY 1991 - S W E D E N!

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

* Re: Command line arguments
       [not found] <Pine.GSO.3.96.981011153419.29087A-100000@yeager.cs.Buffalo.EDU>
@ 1998-10-11  0:00 ` Matthew Heaney
  1998-10-12  0:00 ` Dale Stanbrough
  1 sibling, 0 replies; 18+ messages in thread
From: Matthew Heaney @ 1998-10-11  0:00 UTC (permalink / raw)


Kristian J Allen <kjallen@cse.buffalo.edu> writes:

> Hello,
>    I am trying to take in arguments via the command line but am
> encountering some problems. What i'm trying to do is:
> 
> > <Executable> <Argument1> <Argument2> <Argument3>
> 
> Any tips are greatly appreciated.
> 
> Kristian
> 
> please direct responses to kjallen@cse.buffalo.edu

The command line arguments are available via the predefined package
Ada.Command_Line.  




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

* Re: Command line arguments
       [not found] <Pine.GSO.3.96.981011153419.29087A-100000@yeager.cs.Buffalo.EDU>
  1998-10-11  0:00 ` Command line arguments Matthew Heaney
@ 1998-10-12  0:00 ` Dale Stanbrough
  1998-10-12  0:00   ` Tom Moran
  1 sibling, 1 reply; 18+ messages in thread
From: Dale Stanbrough @ 1998-10-12  0:00 UTC (permalink / raw)


Kristian J Allen  wrote:

" Hello,
     I am trying to take in arguments via the command line but am
  encountering some problems. What i'm trying to do is:
  
  > <Executable> <Argument1> <Argument2> <Argument3>
  
  Any tips are greatly appreciated.
  
  Kristian"

If you look at the Language Reference Manual (the online versions have
an index where you could look up command line arguments) you'll see...


   package Ada.Command_Line...


Use it like this...

   with Ada.Command_Line; use Ada.Command_Line;

   with Text_IO; use Text_IO;

   procedure Demo is
   begin
      for i in 1..Argument_Count loop
         put (Argument (i));
        new_line;
      end loop;
   end;

Look in the LRM for how to get the program name.

Dale




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

* Re: Command line arguments
  1998-10-12  0:00 ` Dale Stanbrough
@ 1998-10-12  0:00   ` Tom Moran
  0 siblings, 0 replies; 18+ messages in thread
From: Tom Moran @ 1998-10-12  0:00 UTC (permalink / raw)


or, to see where various things are defined:
 with Ada.Command_Line; 

   with Text_IO; 

   procedure Demo is
   begin
      for i in 1..Ada.Command_Line.Argument_Count loop
         Ada.Text_IO.put (Ada.Command_Line.Argument (i));
        Ada.Text_IO.new_line;
      end loop;
   end;




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

* Command Line arguments
@ 2000-05-28  0:00 Pedro Diaz Jimenez
  2000-05-28  0:00 ` Robert Dewar
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Pedro Diaz Jimenez @ 2000-05-28  0:00 UTC (permalink / raw)


Hello all:

I'm trying to write a program that takes from command line arguments the
name of file to proccess.  I use the command_package

For some reason I get a CONSTRAINT_ERROR when I try to assing Argument(
2 ) to a string: here is the code

with ADA.Command_line;
use Ada.Command_Line;

procedure com_line is
a : String (integer range 1..100);
begin
        put( Argument_Count );

        -- Here is the error:
        a := Argument( 2 );
        put_Line( a );
end prueba;


I can't understand why this happens, but when I do:
tajo:~/temp4$ ./com_line hello1 hello2 hello3  hello4 hello5 hello6
        7
raised CONSTRAINT_ERROR : com_line.adb:14

I use the gnat compiler for linux


Please send a copy of the reply to diazjimenez@ctv.es
Thanks

Regards
    Pedro





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

* Re: Command Line arguments
  2000-05-28  0:00 Command Line arguments Pedro Diaz Jimenez
@ 2000-05-28  0:00 ` Robert Dewar
  2000-05-29  0:00 ` Gautier
  2000-05-31  0:00 ` Alfred Hilscher
  2 siblings, 0 replies; 18+ messages in thread
From: Robert Dewar @ 2000-05-28  0:00 UTC (permalink / raw)


In article <393124B8.846F51E7@mad.servicom.es>,
  Pedro Diaz Jimenez <lotus@mad.servicom.es> wrote:
> Hello all:
>
> I'm trying to write a program that takes from command line
arguments the
> name of file to proccess.  I use the command_package
>
> For some reason I get a CONSTRAINT_ERROR when I try to assing
Argument(
> 2 ) to a string: here is the code
>
> with ADA.Command_line;
> use Ada.Command_Line;
>
> procedure com_line is
> a : String (integer range 1..100);
> begin
>         put( Argument_Count );
>
>         -- Here is the error:
>         a := Argument( 2 );

This should work perfectly fine and not raise Constraint_Error
providing that the second argument is *EXACTLY* 100 characters
long. If not, you most certainly will get the expected
Constraint_Error that comes from trying to assign arrays whose
lengths do not match.




Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Command Line arguments
  2000-05-28  0:00 Command Line arguments Pedro Diaz Jimenez
  2000-05-28  0:00 ` Robert Dewar
@ 2000-05-29  0:00 ` Gautier
  2000-05-29  0:00   ` Antonio Dur�n Dom�nguez
  2000-05-31  0:00 ` Alfred Hilscher
  2 siblings, 1 reply; 18+ messages in thread
From: Gautier @ 2000-05-29  0:00 UTC (permalink / raw)
  To: diazjimenez

Pedro Diaz Jimenez:

a is a fixed-size string (of length 100)!
Instead of

        a := Argument( 2 );
        put_Line( a );

Try e.g. 
        declare a2: String:= Argument( 2 );
        begin
          put_Line( a2 );
        end;

HTH
______________________________________________________
Gautier  --  http://members.xoom.com/gdemont/gsoft.htm




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

* RE: Command Line arguments
  2000-05-29  0:00 ` Gautier
@ 2000-05-29  0:00   ` Antonio Dur�n Dom�nguez
  2000-05-29  0:00     ` Robert Dewar
                       ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Antonio Dur�n Dom�nguez @ 2000-05-29  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 881 bytes --]

Another alternative:

with Ada.Command_Line;
with Ada.Strings.Unbounded;
with Ada.Text_IO;

use Ada.Command_Line;
use Ada.Strings.Unbounded;
use Ada.Text_IO;

procedure Print_Args
is
begin
    for I in 1 .. Argument_Count loop
        Put_Line(
            "Argument " & Integer'Image(I) & ": " &
To_String(To_Unbounded_String(Argument(I))));
    end loop;
end Print_Args;

with
Gautier <gautier.demontmollin@maths.unine.ch> escribi� en el mensaje de
noticias 39322C67.C6D9489F@maths.unine.ch...
> Pedro Diaz Jimenez:
>
> a is a fixed-size string (of length 100)!
> Instead of
>
>         a := Argument( 2 );
>         put_Line( a );
>
> Try e.g.
>         declare a2: String:= Argument( 2 );
>         begin
>           put_Line( a2 );
>         end;
>
> HTH
> ______________________________________________________
> Gautier  --  http://members.xoom.com/gdemont/gsoft.htm






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

* Re: Command Line arguments
  2000-05-29  0:00   ` Antonio Dur�n Dom�nguez
  2000-05-29  0:00     ` Robert Dewar
@ 2000-05-29  0:00     ` Jeff Carter
  2000-05-30  0:00     ` Gautier
  2000-05-30  0:00     ` Antonio Dur�n Dom�nguez
  3 siblings, 0 replies; 18+ messages in thread
From: Jeff Carter @ 2000-05-29  0:00 UTC (permalink / raw)


"Antonio Dur�n Dom�nguez" wrote:
> 
> Another alternative:
> 
> with Ada.Command_Line;
> with Ada.Strings.Unbounded;
> with Ada.Text_IO;
> 
> use Ada.Command_Line;
> use Ada.Strings.Unbounded;
> use Ada.Text_IO;
> 
> procedure Print_Args
> is
> begin
>     for I in 1 .. Argument_Count loop
>         Put_Line(
>             "Argument " & Integer'Image(I) & ": " &
> To_String(To_Unbounded_String(Argument(I))));
>     end loop;
> end Print_Args;

This is a terrible suggestion. If the idea is to store a specific
argument for some reason, then one of these ways is appropriate:

Way_1 : Unbounded_String := To_Unbounded_String (Argument (2) );
Way_2 : [constant] String := Argument (2);

If the idea is just to output the argument, as above, then one can
simply say:

Put_Line (Argument (2) );

-- 
Jeff Carter
"Your mother was a hamster and your father smelt of elderberries."
Monty Python & the Holy Grail




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

* RE: Command Line arguments
  2000-05-29  0:00   ` Antonio Dur�n Dom�nguez
@ 2000-05-29  0:00     ` Robert Dewar
  2000-05-29  0:00     ` Jeff Carter
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 18+ messages in thread
From: Robert Dewar @ 2000-05-29  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 778 bytes --]

In article <DEqY4.9613$K4.61152@telenews.teleline.es>,
  "Antonio Dur�n Dom�nguez" <andudo@teleline.es> wrote:
>     for I in 1 .. Argument_Count loop
>         Put_Line(
>             "Argument " & Integer'Image(I) & ": " &
>              To_String(To_Unbounded_String(Argument(I))));
>     end loop;
> end Print_Args;

Speaking of inaccurate answers on CLA (see discussion in
another thread :-) .. this is completely absurd coding. I
am not sure what misconception was at work here

In the above, To_String (To_Unbounded_String (Argument (I)))

can of course be replaced simply by Argument (I).

Unless you have a requirement to waste as much computer time
as possible, the simpler replacement is preferable :-)


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Command Line arguments
  2000-05-29  0:00   ` Antonio Dur�n Dom�nguez
  2000-05-29  0:00     ` Robert Dewar
  2000-05-29  0:00     ` Jeff Carter
@ 2000-05-30  0:00     ` Gautier
  2000-05-30  0:00     ` Antonio Dur�n Dom�nguez
  3 siblings, 0 replies; 18+ messages in thread
From: Gautier @ 2000-05-30  0:00 UTC (permalink / raw)


Antonio Dur�n Dom�nguez:

>         Put_Line(
>             "Argument " & Integer'Image(I) & ": " &
> To_String(To_Unbounded_String(Argument(I))));

Why not just

  Put_Line("Argument " & Integer'Image(I) & ": " & Argument(I));

there ?! Argument(I) is a String after all!

______________________________________________________
Gautier  --  http://members.xoom.com/gdemont/gsoft.htm




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

* RE: Command Line arguments
  2000-05-29  0:00   ` Antonio Dur�n Dom�nguez
                       ` (2 preceding siblings ...)
  2000-05-30  0:00     ` Gautier
@ 2000-05-30  0:00     ` Antonio Dur�n Dom�nguez
  3 siblings, 0 replies; 18+ messages in thread
From: Antonio Dur�n Dom�nguez @ 2000-05-30  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1329 bytes --]

Obviously the example is wrong and it is completely absurd. The intent was
to show how to avoid Constraint_Error
when getting the arguments by using an Unbounded_String and the code example
doesn't show it.

Sorry and please forgive me.

Antonio Dur�n Dom�nguez <andudo@teleline.es> escribi� en el mensaje de
noticias DEqY4.9613$K4.61152@telenews.teleline.es...
> Another alternative:
>
> with Ada.Command_Line;
> with Ada.Strings.Unbounded;
> with Ada.Text_IO;
>
> use Ada.Command_Line;
> use Ada.Strings.Unbounded;
> use Ada.Text_IO;
>
> procedure Print_Args
> is
> begin
>     for I in 1 .. Argument_Count loop
>         Put_Line(
>             "Argument " & Integer'Image(I) & ": " &
> To_String(To_Unbounded_String(Argument(I))));
>     end loop;
> end Print_Args;
>
> with
> Gautier <gautier.demontmollin@maths.unine.ch> escribi� en el mensaje de
> noticias 39322C67.C6D9489F@maths.unine.ch...
> > Pedro Diaz Jimenez:
> >
> > a is a fixed-size string (of length 100)!
> > Instead of
> >
> >         a := Argument( 2 );
> >         put_Line( a );
> >
> > Try e.g.
> >         declare a2: String:= Argument( 2 );
> >         begin
> >           put_Line( a2 );
> >         end;
> >
> > HTH
> > ______________________________________________________
> > Gautier  --  http://members.xoom.com/gdemont/gsoft.htm
>
>






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

* Re: Command Line arguments
  2000-05-28  0:00 Command Line arguments Pedro Diaz Jimenez
  2000-05-28  0:00 ` Robert Dewar
  2000-05-29  0:00 ` Gautier
@ 2000-05-31  0:00 ` Alfred Hilscher
  2 siblings, 0 replies; 18+ messages in thread
From: Alfred Hilscher @ 2000-05-31  0:00 UTC (permalink / raw)




Pedro Diaz Jimenez wrote:
> 
> Hello all:
> 
> I'm trying to write a program that takes from command line arguments the
> name of file to proccess.  I use the command_package
> 
> For some reason I get a CONSTRAINT_ERROR when I try to assing Argument(
> 2 ) to a string: here is the code
> 
> with ADA.Command_line;
> use Ada.Command_Line;
> 
> procedure com_line is
> a : String (integer range 1..100);
> begin
>         put( Argument_Count );
> 
>         -- Here is the error:
>         a := Argument( 2 );
>         put_Line( a );
> end prueba;

I think your code will not even compile: "procedure com_line .... end
prueba;". Mismatching name.




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

end of thread, other threads:[~2000-05-31  0:00 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-28  0:00 Command Line arguments Pedro Diaz Jimenez
2000-05-28  0:00 ` Robert Dewar
2000-05-29  0:00 ` Gautier
2000-05-29  0:00   ` Antonio Dur�n Dom�nguez
2000-05-29  0:00     ` Robert Dewar
2000-05-29  0:00     ` Jeff Carter
2000-05-30  0:00     ` Gautier
2000-05-30  0:00     ` Antonio Dur�n Dom�nguez
2000-05-31  0:00 ` Alfred Hilscher
     [not found] <Pine.GSO.3.96.981011153419.29087A-100000@yeager.cs.Buffalo.EDU>
1998-10-11  0:00 ` Command line arguments Matthew Heaney
1998-10-12  0:00 ` Dale Stanbrough
1998-10-12  0:00   ` Tom Moran
  -- strict thread matches above, loose matches on Subject: below --
1991-04-23 20:51 Data Files David M. Onder
1991-04-25 14:37 ` Ralph Reid III
1991-04-29 22:16   ` Command line arguments Erland Sommarskog
1991-04-30  5:40     ` rharwood
1991-04-30 13:57     ` Steve Gabrilowitz
1991-05-01 23:57       ` Charles H. Sampson
1991-05-02 11:20         ` Joe Orost
1991-05-06 21:56           ` Erland Sommarskog

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