* Re: Using command-line arguments
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
0 siblings, 1 reply; 5+ messages in thread
From: Gisle S�lensminde @ 2000-04-10 0:00 UTC (permalink / raw)
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;
--
--
Gisle S�lensminde ( gisle@ii.uib.no )
ln -s /dev/null ~/.netscape/cookies
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Using command-line arguments
2000-04-10 0:00 ` Gisle S�lensminde
@ 2000-04-10 0:00 ` Gisle S�lensminde
2000-04-10 0:00 ` Kai Glsner
0 siblings, 1 reply; 5+ messages in thread
From: Gisle S�lensminde @ 2000-04-10 0:00 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Using command-line arguments
@ 2000-04-10 0:00 Kai Glsner
2000-04-10 0:00 ` Gisle S�lensminde
0 siblings, 1 reply; 5+ messages in thread
From: Kai Glsner @ 2000-04-10 0:00 UTC (permalink / raw)
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.
Kai Glaesner
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Using command-line arguments
2000-04-10 0:00 ` Gisle S�lensminde
@ 2000-04-10 0:00 ` Kai Glsner
2000-04-10 0:00 ` Marin D. Condic
0 siblings, 1 reply; 5+ messages in thread
From: Kai Glsner @ 2000-04-10 0:00 UTC (permalink / raw)
Thank you very much,
I never thought that something can be so simlpe in Ada....;-)
Kai
Gisle Slensminde schrieb in Nachricht ...
>In article <slrn8f3511.nhe.gisle@struts.ii.uib.no>, Gisle Slensminde
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 Slensminde ( gisle@ii.uib.no )
>
>ln -s /dev/null ~/.netscape/cookies
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Using command-line arguments
2000-04-10 0:00 ` Kai Glsner
@ 2000-04-10 0:00 ` Marin D. Condic
0 siblings, 0 replies; 5+ messages in thread
From: Marin D. Condic @ 2000-04-10 0:00 UTC (permalink / raw)
Kai Glsner wrote:
> I never thought that something can be so simlpe in Ada....;-)
>
Usually, there is a simple way to do most things in Ada. It just
requires some experience with the language. You might try looking at the
Adapower website (www.adapower.com) for additional help & examples of
how to do various things.
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]
======================================================================
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2000-04-10 0:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2000-04-10 0:00 ` Kai Glsner
2000-04-10 0:00 ` Marin D. Condic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox