home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!seismo!darwin.sura.net!gatech!swrinde!emory!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sunic!liuida!d92magax
- From: d92magax@odalix.ida.liu.se (Magnus Axelsson)
- Newsgroups: comp.lang.pascal
- Subject: Re: help
- Message-ID: <1993Jan24.154416.18923@ida.liu.se>
- Date: 24 Jan 93 15:44:16 GMT
- References: <8290@kielo.uta.fi>
- Sender: news@ida.liu.se
- Organization: CIS Dept, Univ of Linkoping, Sweden
- Lines: 35
-
- csfraw@vehka.cs.uta.fi (Francis Akoto) writes:
-
- >This is a pascal code which i thought was wrong : can anyone out there explain
- >what values i gets ( or can it be written in another way )
-
- >var i,j: integer ;
- >.....
- >....
- > i := i or j ;
- >......
-
-
- >--
- >gallows
- > Opinions are like assholes;
- > Everybody has one but nobody wants to look at the others.
-
-
- The operand OR works on the bitpattern of the integers you defined
- according to the following example:
-
- i:=19; (* in binary 0000 0000 0001 0011 *)
- j:=65; (* 0000 0000 0100 0001 *)
- i:=i OR j; (* Will set i to 83 0000 0000 0101 0011 *)
-
- If any of the two bits (or both) in a column of i and j are set the same
- bit will be set in the result.
-
-
- Happy programming!
-
- Magnus Axelsson,
- Student at University of Linkoping, Sweden
- d92magax@und.ida.liu.se
-
-