comp.lang.ada
 help / color / mirror / Atom feed
From: gisle@struts.ii.uib.no (Gisle S�lensminde)
Subject: Re: Using command-line arguments
Date: 2000/04/10
Date: 2000-04-10T00:00:00+00:00	[thread overview]
Message-ID: <slrn8f3c90.nti.gisle@struts.ii.uib.no> (raw)
In-Reply-To: slrn8f3511.nhe.gisle@struts.ii.uib.no

In article <slrn8f3511.nhe.gisle@struts.ii.uib.no>, Gisle S�lensminde wrote:
>In article <8crv0s$e58$1@news.sns-felb.debis.de>, Kai Glsner wrote:
>>Hello Community,
>>
>>I have a question concerning the usage of command-line arguments in Ada. For
>>the start I try to give my main-routine two integer-values using
>>Ada.Command_Line.Argument (). But this  function gives back a string...
>>
>>How can I deal with strings (or options), integers and floats as
>>command-line arguments
>>
>>Thanks in advance for the answer.
>
>with ada.command_line;
>with ada.text_io; use ada.text_io;
>
>procedure test is
>begin
>  put_line(Integer'value(ada.command_line.argument(1)));
>  put_line(Integer'value(ada.command_line.argument(2)));
>end;

Sorry, my mind collapsed for a moment. The contents of put_line
was correct, but put_line only takes strings as parameters.
The example under is hopefully better. It compiles at least.

with ada.command_line;
with ada.text_io; use ada.text_io;

procedure test is

A, B : integer

begin
  A := Integer'value(ada.command_line.argument(1));
  B := Integer'value(ada.command_line.argument(2));
end;


-- 
--
Gisle S�lensminde ( gisle@ii.uib.no )   

ln -s /dev/null ~/.netscape/cookies




  reply	other threads:[~2000-04-10  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-10  0:00 Using command-line arguments Kai Glsner
2000-04-10  0:00 ` Gisle S�lensminde
2000-04-10  0:00   ` Gisle S�lensminde [this message]
2000-04-10  0:00     ` Kai Glsner
2000-04-10  0:00       ` Marin D. Condic
replies disabled

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