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.
Kai Glaesner
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;
--
--
Gisle Sælensminde ( gi...@ii.uib.no )
ln -s /dev/null ~/.netscape/cookies
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));
I never thought that something can be so simlpe in Ada....;-)
Kai
Gisle Slensminde schrieb in Nachricht ...
>In article <slrn8f3511...@struts.ii.uib.no>, Gisle Slensminde
>Gisle Slensminde ( gi...@ii.uib.no )
>
>ln -s /dev/null ~/.netscape/cookies
MDC
--
======================================================================
Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/
Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m
Visit my web site at: http://www.mcondic.com/
"I'd trade it all for just a little more"
-- Charles Montgomery Burns, [4F10]
======================================================================