home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / BITMAP4.ZIP / BITMAP4.DOC next >
Encoding:
Text File  |  1980-09-12  |  1.4 KB  |  46 lines

  1. BitMap4.Doc
  2.  
  3. 1986
  4. Original work by Steve Fox.
  5.  
  6. 1987
  7. Bit_Map2 modIfications by W. Mabee, CRNA And H. Kaemerrer.
  8.  
  9. 1988
  10. Bit_Map4 Modified For Turbo4.0 By W. Mabee, CRNA.
  11. Added code to ease manipulation of data required.
  12.  
  13. Discussion :
  14.  
  15. Many applications require the storeage of a large number of
  16. boolean reaponses. If these responses are part of a record
  17. and a large number of these records are saved to disk. A
  18. sizeable amount of disk storeage space can be save by saving
  19. each of these values as a single bit.
  20.  
  21. Consider the storeage of 32 boolean answers, if stored as an
  22. Array [1..32] Of Boolean, 32 bytes are required. However, if
  23. stored as bits using the technique described in BitMap4 the
  24. space required is decreased to 4 bytes (2 Integers).
  25.  
  26. In a program where a large number of records are saved to
  27. disk the savings can be considerable. For Example consider
  28. 1000 records.
  29.  
  30. Store as an Array[1..32] Of Boolean = 32000 Bytes
  31. Stored as an Array[1..2] Of Integer =  4000 Bytes
  32. (* Note Each Integer Occupies 2 Bytes or 16 Bits *)
  33.  
  34. Obviously the more records stored the greater the savings.
  35. However, if you are trying to block a records length in
  36. 64 byte blocks and you need to save space this technique
  37. can also be helpful.
  38.  
  39. Would like to use a similar technique to store 32 bits in
  40. a LongInt (4 Bytes : 32 Bits) but can't seem to figure out
  41. the logic to handle this. If you can, please share it with
  42. all of us.
  43.  
  44. Regards;
  45. Bill Mabee
  46.