-
Notifications
You must be signed in to change notification settings - Fork 2
_byte
#byte
###Convert to an unsigned byteacter value or create an unsigned byteacter variable.
Syntax
result = byte value ;
byte variable [= value] ;
Arguments
- list value
A value of any type.
Return Value
byte result
- byteacter : A signed 8 bit value.
The STATUS variable is set to $ACKNOWLEDGE
When the argument is an array variable, all the elements in the array are converted, and the result will be a vector array byte result
- byteacter : A signed 8 bit value.
The STATUS variable is set to $ACKNOWLEDGE
When the argument is an array variable, all the elements in the array are converted, and the result will be a vector array
Exceptions
-
%ARGUMENT: Invalid arguments. Usage: byte variable [= value] ;
-
%IDENTIFIER: 'variable' argument is not a valid identifier, literal, or reference
Description
byte -128 to +127
ubyte 0 to 255
- byte and ubyte are interchangable, the sign bit is never lost.
- The ubyte format is the same as the binary format except in the manner in which the value is displayed, decimal for ubyte and hexidecimal for binary.
A byte and ubyte formats are a one-byte signed and unsigned integer, respectively. The values range from0x00 through 0xff, which in the signed byte case is between -128 and +127, and between 0 and 255 for the unsigned byte.
Examples
put byte ( 127 ) ; //== 128
put byte ( 128 ) ; //== -128
put byte ( 255 ) ; //== -1
put byte ( 256 ) ; //== 0
put byte ( 257 ) ; //== 1
Related Links