CUByte

Converts numeric or string expression to an unsigned byte (KeyPgUbyteUByte)

Syntax
	KeyPgDeclareDeclare KeyPgFunctionFunction CUByte ( KeyPgByvalByVal expression KeyPgAsAs DataTypedatatype ) KeyPgAsAs KeyPgUbyteUByte

	KeyPgTypeType typename
		KeyPgDeclareDeclare KeyPgOperatorOperator KeyPgCastCast ( ) KeyPgAsAs KeyPgUbyteUByte
	End Type

Usage
	result = CUByte( numeric expression )
	result = CUByte( string expression )
	result = CUByte( user defined type )

Parameters
	expression
		a numeric, string, or pointer expression to cast to a KeyPgUbyteUByte value
	datatype
		any numeric, string, or pointer data type
	typename
		a user defined type

Return Value
	A KeyPgUbyteUByte value.

Description
	The CUByte function rounds off the decimal part and returns a 8-bit KeyPgUbyteUByte
	value. The function does not check for an overflow, and results are 
	undefined for values which are less than 0 or larger than 255.

	The name can be explained as 'Convert to Unsigned Byte'.

	If the argument is a string expression, it is converted to numeric by 
	using KeyPgValuintValUInt.

Example
	' Using the CUBYTE function to convert a numeric value

	'Create an UNSIGNED BYTE variable
	Dim numeric_value As UByte

	'Convert a numeric value
	numeric_value = CUByte(123.55)

	'Print the result, should return 124
	Print numeric_value
	Sleep

Dialect Differences
	* Not available in the CompilerOptlang-lang qb dialect unless referenced with the 
	  alias __Cubyte.

Differences from QB
	* New to FreeBASIC

See also
	* KeyPgCbyteCByte
	* KeyPgCshortCShort
	* KeyPgCushortCUShort
	* KeyPgCintCInt
	* KeyPgCuintCUInt
	* KeyPgClngCLng
	* KeyPgCulngCULng
	* KeyPgClngintCLngInt
	* KeyPgCulngintCULngInt
	* KeyPgCsngCSng
	* KeyPgCdblCDbl

