CUShort

Converts numeric or string expression to an unsigned integer (KeyPgUshortUShort)

Syntax
	KeyPgDeclareDeclare KeyPgFunctionFunction CUShort ( KeyPgByvalByVal expression KeyPgAsAs DataTypedatatype ) KeyPgAsAs KeyPgUshortUShort

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

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

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

Return Value
	A KeyPgUshortUShort value.

Description
	The CUShort function rounds off the decimal part and returns a 16-bit 
	KeyPgUshortUShort value.  The function does not check for an overflow, and results 
	are undefined for values which are less than 0 or larger than 65 535.

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

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

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

	'Create an USHORT variable
	Dim numeric_value As UShort

	'Convert a numeric value
	numeric_value = CUShort(36000.4)

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

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

Differences from QB
	* New to FreeBASIC

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

