home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / pascal / 8496 < prev    next >
Encoding:
Internet Message Format  |  1993-01-24  |  1.3 KB

  1. 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
  2. From: d92magax@odalix.ida.liu.se (Magnus Axelsson)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: help
  5. Message-ID: <1993Jan24.154416.18923@ida.liu.se>
  6. Date: 24 Jan 93 15:44:16 GMT
  7. References: <8290@kielo.uta.fi>
  8. Sender: news@ida.liu.se
  9. Organization: CIS Dept, Univ of Linkoping, Sweden
  10. Lines: 35
  11.  
  12. csfraw@vehka.cs.uta.fi (Francis Akoto) writes:
  13.  
  14. >This is a pascal code which i thought was wrong : can anyone out there explain
  15. >what values i gets ( or can it be written in another way )
  16.  
  17. >var    i,j: integer ;
  18. >.....
  19. >....
  20. >    i := i or j ;
  21. >......
  22.  
  23.  
  24. >--
  25. >gallows
  26. >     Opinions are like assholes;
  27. >     Everybody has one but nobody wants to look at the others.
  28.  
  29.  
  30. The operand OR works on the bitpattern of the integers you defined
  31. according to the following example:
  32.  
  33. i:=19;                  (* in binary 0000 0000 0001 0011 *)
  34. j:=65;                  (*           0000 0000 0100 0001 *)
  35. i:=i OR j;    (* Will set i to 83    0000 0000 0101 0011 *)
  36.  
  37. If any of the two bits (or both) in a column of i and j are set the same
  38. bit will be set in the result.
  39.  
  40.  
  41. Happy programming!
  42.  
  43. Magnus Axelsson,
  44. Student at University of Linkoping, Sweden
  45. d92magax@und.ida.liu.se
  46.  
  47.