Hex digit verification


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default

    Hi Chris,
    You actually posted while I was typing my reply - I didn't see your own response.

    Anyway, if you can afford two new bytes, lets call them Ones and Tens then you could do something like this instead (it produces slightly smaller code:
    Code:
    Ones VAR BYTE
    Tens VAR BYTE
     
    Ones = CheckPanelDigit & 15
    Tens = (CheckPanelDigit & 240) >> 4
     
    If Ones < 10 AND Tens < 10 then
    '....more code here
    This will then allow you to do something like:
    Code:
    SwappedValue VAR BYTE
    SwappedValue = Ones << 4 + Tens
    Which swappes the order of the high and low nibble in the byte.

    /Henrik.

  2. #2
    Join Date
    Dec 2005
    Location
    Salt Lake City, Ut, USA
    Posts
    108


    Did you find this post helpful? Yes | No

    Default

    Very cool Henrick, thanks. When I get a second to try that code, I will. I'll report back asap.

    Thanks again,
    Chris

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