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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: Japanese,JIS X-Google-Thread: 103376,5815493d721e0922 X-Google-Attributes: gid103376,public From: "Kai Glsner" Subject: Re: Using command-line arguments Date: 2000/04/10 Message-ID: <8cseda$k9f$1@news.sns-felb.debis.de>#1/1 X-Deja-AN: 609061415 References: <8crv0s$e58$1@news.sns-felb.debis.de> X-Forwarded: by - (DeleGate/5.9.12) Content-Type: text/plain; charset=ISO-2022-JP X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Complaints-To: news@sns-felb.debis.de X-Trace: news.sns-felb.debis.de 955366634 20783 53.122.2.34 (10 Apr 2000 11:37:14 GMT) Organization: InterNetNews debis Systemhaus Mime-Version: 1.0 (generated by MimeKit/1.8) NNTP-Posting-Date: 10 Apr 2000 11:37:14 GMT Newsgroups: comp.lang.ada Date: 2000-04-10T11:37:14+00:00 List-Id: Thank you very much, I never thought that something can be so simlpe in Ada....;-) Kai Gisle Slensminde schrieb in Nachricht ... >In article , 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