Returns the expression converted to a byte data type (Byte).

expressionThe expression to evaluate and convert to a byte.

* The Byte data type is a Value data type.
* The "expression" can be any numerical value between 0 to 255 (Integer).
* A byte takes up a single byte of computer memory and can have a value from 0 to 255.
* This data type is commonly used for file formats and data conversions.
* If the expression is not a floating point number then it is rounded to the nearest integer.
* An overflow error will occur if the value is out of range.
* For the Microsoft documentation refer to docs.microsoft.com

CByte("some text") = "Type mismatch error"
CByte(256) = "Overflow error"
CByte(-1) = "Overflow error"

© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited Top