Checking Bit of a Byte using another variable


Results 1 to 8 of 8

Threaded View

  1. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Check.0[Days] tells PBP to treat Check as a bit array with Days as the bit index pointer.

    Since Check is a byte PBP will treat it as an 8-bit array. The lowest bit will be 0, and the
    highest bit will be 7.

    If Days = 5; then IF Check.0[Days]=1 will be testing bit position 6 in Check if you're
    counting bit positions in Check from left-to-right as 87654321.

    Then you would use; IF Check.0[Days-1]=1 THEN.

    If you're counting bit positions in Check from left-to-right as 76543210 then it would work
    with; IF Check.0[Days]=1 THEN.
    Last edited by Bruce; - 10th December 2010 at 23:13. Reason: Better explanaition
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts