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-7-bit X-Google-Thread: 103376,9cda729d126da2d3 X-Google-Attributes: gid103376,public From: John English Subject: Re: how to convert string to float type? Date: 2000/11/09 Message-ID: <3A0A8C15.41F7B9C7@bton.ac.uk>#1/1 X-Deja-AN: 691581935 Content-Transfer-Encoding: 7bit References: <3A0A754B.5275EC0@cse.cuhk.edu.hk> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: news@bton.ac.uk X-Trace: saturn.bton.ac.uk 973769773 17610 193.62.183.204 (9 Nov 2000 11:36:13 GMT) Organization: University of Brighton Mime-Version: 1.0 NNTP-Posting-Date: 9 Nov 2000 11:36:13 GMT Newsgroups: comp.lang.ada Date: 2000-11-09T11:36:13+00:00 List-Id: Hackker Wong wrote: > i am doing a calculator homework. i use get() in text_io to read the > whole expression including (+, -, *, /, numbers) in string format. but i > have a problem in converting sub-string to float type. would anyone help > me? Two possibilities suggest themselves: 1) use the 'Value attribute (RM95 Annex K, available online at http://burks.bton.ac.uk/burks/language/ada/lrm95/k.htm, paras 264-267) 2) use some of the facilities defined in Ada.Float_Text_IO (see http://burks.bton.ac.uk/burks/language/ada/lrm95/a_10_09.htm). ----------------------------------------------------------------- John English | mailto:je@brighton.ac.uk Senior Lecturer | http://www.it.bton.ac.uk/staff/je Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS ** University of Brighton | -- see http://burks.bton.ac.uk -----------------------------------------------------------------