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,991f222102c1cd00 X-Google-Attributes: gid103376,public From: dewarr@my-dejanews.com Subject: Re: Type Conversion Date: 1998/11/01 Message-ID: <71huur$btv$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 407250316 References: <71g71d$r7d@news3.force9.net> X-Http-Proxy: 1.0 x8.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Sun Nov 01 15:32:43 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/2.02 (OS/2; I) Date: 1998-11-01T00:00:00+00:00 List-Id: In article <71g71d$r7d@news3.force9.net>, "Heather Wright" wrote: > Probably a really lame question, but what is the syntax for type conversion > in Ada? > > I'm trying to convert a float to an int (or vice-versa if necessary), the > help files are doing > me no good and the closest thing I found online was a comparison between > type conversion and > qualifier. > > Yeah, I'm a complete Newbie at Ada. > > Thanks very much for any help, You should definitely be able to answer simple syntax questions like this for yourself. The RM is complex to read, but the *syntax* sections should be perfectly straightforward, and if you don't understand the BNF notation that is used there, make the effort to learn and understand it (understanding BNF is an absolutely essential piece of knowledge for any programmer). THe relevant syntax rules can be found in Annex P, where they are gathered together, or you can trivially find the right section in the RM with a simple search (or using the index!): 4.6 Type Conversions 1 Explicit type conversions, both value conversions and view conversions, are allowed between closely related types as defined below. This clause also defines rules for value and view conversions to a particular subtype of a type, both explicit ones and those implicit in other constructs. Syntax 2 type_conversion ::= subtype_mark(expression) | subtype_mark(name) -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own