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: ENGLISH,ASCII X-Google-Thread: 103376,5815493d721e0922 X-Google-Attributes: gid103376,public From: gisle@struts.ii.uib.no (Gisle S�lensminde) Subject: Re: Using command-line arguments Date: 2000/04/10 Message-ID: #1/1 X-Deja-AN: 609047949 Content-Transfer-Encoding: 8bit References: <8crv0s$e58$1@news.sns-felb.debis.de> Organization: University of Bergen, Norway Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-04-10T00:00:00+00:00 List-Id: In article , 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