cEvKG‖

upwSd‖CByte Function

qP4eK‖Converts a string or a numeric expression to the Byte type.

FVEx2‖Syntax:


8h2Wu‖Cbyte( expression As Variant) As Byte

GePPP‖Return value:

Byte

WADQ4‖Parameters:

4vJi5‖Expression: Any string or a numeric expression that can be evaluated to a number. Decimal values are rounded to the nearest tenth. Valid values range from 0 to 256.

SEjHR‖Error codes:

5 Invalid procedure call

6 Overflow

EFSA4‖Example:


  Sub CByte_example
      Print CByte( expression := "17"/2 + 7.44), CByte(EMPTY), CByte(PI)
  Nc9fn‖    ' Above expressions are computed as 16, 0 and 3
  End Sub