v = ByteVal(s$[, type, le])
s$
to
a numeric value. The number of bytes that will be read from the string s$
depend on
the type that you pass in the type
argument. The following types are currently
supported:
#BYTE:
#SHORT:
#INTEGER:
#FLOAT:
#DOUBLE:
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 read from s$
. If you set le
to True
, the bytes will be read in little
endian order (LSB first), otherwise the bytes will be read in big endian
order (MSB first). Big endian is also the default.
Note that for all integer types the result will always be unsigned. You can use the Cast() function if you need to cast the result to a signed type. See Cast for details.
If you need to convert a value to raw bytes, you can use the ByteStrStr() function. See ByteStrStr for details.
#INTEGER
)False
)