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,8309f2bc055237c4 X-Google-Attributes: gid103376,public From: Kilgallen@eisner.decus.org.nospam (Larry Kilgallen) Subject: Re: Bit manipulation Date: 2000/11/07 Message-ID: <2WTH$pdrCfOd@eisner.decus.org>#1/1 X-Deja-AN: 690780456 References: <8u8v6n$b7o$1@nnrp1.deja.com> X-Complaints-To: abuse@verio.net X-Trace: iad-read.news.verio.net 973603801 216.44.122.34 (Tue, 07 Nov 2000 13:30:01 GMT) Organization: LJK Software NNTP-Posting-Date: Tue, 07 Nov 2000 13:30:01 GMT Newsgroups: comp.lang.ada Date: 2000-11-07T00:00:00+00:00 List-Id: In article <8u8v6n$b7o$1@nnrp1.deja.com>, Sandro Binetti writes: > Hi, > is there anyone who can help me with bit manipulation on objects like > integers or character? > > Which way may I shift bits, or maskerade them? Quite often when someone wants to do something like that, they had formerly programmed in some other language whose ability to define data types is not so robust as Ada. Except for the particular situation of changing case of an ASCII Roman letter (for which Ada95 has built-in capabilities), flipping a bit in a character is totally meaningless. If you really meant to blip a bit in a data cell that happens to be 8 bits wide, then please study record and array declarations in an introductory Ada text. If you have to match some external standard, such as hardware or a program written in another language, look at the part about representation clauses.