Menu

Low and High Bytes

Help
2007-02-23
2013-05-30
  • Russ Hensel

    Russ Hensel - 2007-02-23

    Is there an easy way to use words ( 2 bytes ) and then access the high and low byte seperately and
    efficiently?

    Russ

     
    • Hugh Considine

      Hugh Considine - 2007-02-24

      Something like this is the best way:

      dim WordVar as word

      LowByte = WordVar
      HighByte = WordVar_H

      To copy back the other way:

      dim WordVar as word

      WordVar = LowByte
      WordVar_H = HighByte

      When copying two bytes into a word, it is important to copy the low byte first. This is because the high byte of the word var is cleared when the word var is set to a byte value or variable.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.