Name
ByteStrStr -- convert value to raw bytes (V8.0)
Synopsis
r$ = ByteStrStr(v[, type, le])
Function
This function can be used to convert a numeric value to raw bytes that are returned as a string. The number of bytes that will be written to the return string depend on the type that you pass in the type argument. The following types are currently supported:

#BYTE:
Stores an 8-bit value (1 byte) in the return string.

#SHORT:
Stores a 16-bit value (2 bytes) in the return string.

#INTEGER:
Stores a 32-bit value (4 bytes) in the return string. This is the default.

#FLOAT:
Stores a 32-bit floating point value (4 bytes) in the return string.

#DOUBLE:
Stores a 64-bit floating point value (8 bytes) in the return string.

For all multi-byte types, i.e. all types except #BYTE, you can use the additional le argument to specify the order in which the bytes should be stored in the return string. If you set le to True, the bytes will be stored in little endian order (LSB first), otherwise the bytes will be stored in big endian order (MSB first). Big endian is also the default.

If you need to convert raw bytes to a value, you can use the ByteVal() function. See ByteVal for details.

Inputs
v
numeric value to convert to binary data
type
optional: type of value to store in string (defaults to #INTEGER)
le
optional: whether or not to use little endian byte order (defaults to False)
Results
r$
resulting string

Show TOC