Lasso Soft Inc. > Home

[ bytes->import16bits ]

Method

[bytes->import16Bits] appends the low 16 bits (2 bytes) of an integer onto the end of the byte stream. The integer parameter is converted into an unsigned short and then imported.

  • Syntax
bytes->import16Bits(32000)
Examples
  • Intermediate

 

This example imports an integer into a bytes object and prints the value as hexadecimal.

Code

bytes->import16Bits(32101) & encodeHex

Result

657D
Resources
  • Tips

 

The integer's bytes are imported using the endianess of the host machine. Look at [integer->hostToNet16] and [integer->netToHost16] to perform byte swapping.

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft