CShort

Converts numeric or string expression to an integer (KeyPgShortShort)

Syntax
	KeyPgDeclareDeclare KeyPgFunctionFunction CShort ( KeyPgByvalByVal expression KeyPgAsAs DataTypedatatype ) KeyPgAsAs KeyPgShortShort

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

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

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

Return Value
	A KeyPgShortShort value.

Description
	The CShort function rounds off the decimal part and returns a 16-bit 
	KeyPgShortShort value.  The function does not check for an overflow, and results 
	are undefined for values which are less than -32 768 or larger than 32 
	767.

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

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

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

	'Create an SHORT variable
	Dim numeric_value As Short

	'Convert a numeric value
	numeric_value = CShort(-4500.66)

	'Print the result, should return -4501
	Print numeric_value
	Sleep

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

Differences from QB
	* New to FreeBASIC

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

