byte

Module: ecereCOM
Type: Basic Data Type

Description

An unsigned integer data type representing a single byte of data (equivalent to C 'unsigned char' and expected to be equivalent to C99 'uint8_t'). A byte can range from 0 to 255. Often used to allocate and address memory.

Usage


Used in the declaration section of code, which is before any statements.

Example

byte a = 3; // binary form: 00000011
byte b = 6; // binary form: 00000110
byte c;
c = a & b; // c will be 2 (00000010)
c = a | b; // c will be 7 (00000111)
c = a ^ b; // c will be 5 (00000101)
c = ~b; // c will be 249(11111001)

Remarks


Unlike other languages the byte data type is actually a class.

byte is equivalent to an unsigned char in C.

See Also


bool, char, char *, double, enum, float, int, int64, uint, uint16, uint32, uint64, OnCompare(), OnCopy(), OnDisplay(), OnEdit(), OnFree(), OnGetDataFromString(), OnGetString(), OnSaveEdit(), OnSerialize(), OnUnserialize()