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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,71c7addfc8ec82f6 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Command Line arguments Date: 2000/05/28 Message-ID: <8grdle$phb$1@nnrp1.deja.com>#1/1 X-Deja-AN: 628269929 References: <393124B8.846F51E7@mad.servicom.es> X-Http-Proxy: 1.0 x58.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Sun May 28 15:23:36 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-05-28T00:00:00+00:00 List-Id: In article <393124B8.846F51E7@mad.servicom.es>, 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 ); 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.