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,7e021fc0e7fc15a1 X-Google-Attributes: gid103376,public From: Al Christians Subject: Re: Ada 95 LRM Error? Date: 1999/01/27 Message-ID: <36AFC42A.57696F4D@easystreet.com>#1/1 X-Deja-AN: 437769156 Content-Transfer-Encoding: 7bit References: <36AF6C22.896FC5B8@easystreet.com> <78oaj9$d9g@sjx-ixn5.ix.netcom.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Trace: news7.ispnews.com 917487966 206.103.56.64 (Wed, 27 Jan 1999 20:46:06 EDT) Organization: Trillium Resources Corporation MIME-Version: 1.0 NNTP-Posting-Date: Wed, 27 Jan 1999 20:46:06 EDT Newsgroups: comp.lang.ada Date: 1999-01-27T00:00:00+00:00 List-Id: Richard D Riehle wrote about Interfaces.Cobol: > > As it is, the package is defined so it conforms to the conventions of > typical COBOL programming. > But if I put non-numeric data into a Numeric, it will flunk the Valid() test, right? Since you speak of 'typical COBOL programming', can you enlighten me a little about why this interface looks the way it does? For example, the To_Binary(Num, Binary_Format) function returns a Byte_Array and not a Binary, and there is no corresponding To_Long_Binary. It looks like To_Binary decides what length of Byte_Array to give back based on the digits of Num. I suppose that the compiler can figure this all out at compile time, since digits is static, but it seems a little odd that the size of a Byte_Array is never really set anywhere in the visible code, but the subtype returned from To_Binary depends on Num's digits. It's also a little confusing that there are 2 binary types, ie Binary and Long_Binary, but that in GNAT, for example, the return values from To_Binary, come in four different sizes (I think). That the Binary_Format doesn't specify the field size also makes it a little hard to be consistent with the Cobol code I know about, which allows a compile time switch to indicate whether or not a number with fewer than 3 digits uses one or two bytes. Here Interfaces.Cobol decides that for me behind the scenes. Thanks for your assistance, Richard. Al