home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Programmer'…arterly (Limited Edition) / Visual_Basic_Programmers_Journal_VB-CD_Quarterly_Limited_Edition_1995.iso / code / ch21code / integer.cls < prev    next >
Text File  |  1995-08-14  |  670b  |  35 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "clsInteger"
  6. Attribute VB_Creatable = True
  7. Attribute VB_Exposed = True
  8. ' clsInteger class -- INTEGER.CLS
  9. '   Parses Integers (words) into bytes.
  10. '
  11. '   Properties:
  12. '       Value
  13. '
  14. '   Methods:
  15. '       LoByte
  16. '       HiByte
  17. '
  18. Option Explicit
  19.  
  20. ' Value property.
  21. Public Value
  22.  
  23. ' HiByte method.
  24. Public Function HiByte()
  25.     ' Return the high byte from an integer.
  26.     HiByte = (Me.Value And &HFF00) \ &H100
  27.  End Function
  28.  
  29. ' LoByte method.
  30. Public Function LoByte()
  31.     ' Return the high byte from an integer.
  32.     LoByte = Me.Value Xor (Me.Value And &HFF00)
  33. End Function
  34.  
  35.