comp.lang.ada
 help / color / mirror / Atom feed
* 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
[parent not found: <Pine.GSO.3.96.981011153419.29087A-100000@yeager.cs.Buffalo.EDU>]
* Data Files...
@ 1991-04-23 20:51 David M. Onder
  1991-04-25 14:37 ` Ralph Reid III
  0 siblings, 1 reply; 18+ messages in thread
From: David M. Onder @ 1991-04-23 20:51 UTC (permalink / raw)


I would like to know if it is possible to give ADA a data file name
on the command line for use in the program.  I have to write a program
for class that will count the number of characters in a file, and I
want to make it as generic as possible.

Thank You!

^ 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     ` Jeff Carter
2000-05-29  0:00     ` Robert Dewar
2000-05-30  0:00     ` Antonio Dur�n Dom�nguez
2000-05-30  0:00     ` Gautier
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