Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>word_2_num() convert a 2 byte string to numeric rlback.prg</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Word_2_num()   Convert a 2 byte string to numeric      Rlback.prg


Syntax:        Word_2_num(<expC>)

Argument:      <expC> is a 2-byte character string representing a
               binary number in LSB, MSB order

Returns:       A numeric value.


--------------------------------- Source Code ------------------------------

   FUNCTION WORD_2_NUM

   PARAMETERS byte_string

   PRIVATE numeric

   numeric = ASC(SUBSTR(byte_string, 1, 1)) +;           && extract LSB
             ASC(SUBSTR(byte_string, 2, 1)) * 256        && extract MSB

   RETURN (numeric)



See Also: I2BIN()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson