CSng

Converts numeric or string expression to KeyPgSingleSingle precision floating point

Syntax
	KeyPgDeclareDeclare KeyPgFunctionFunction CSng ( KeyPgByvalByVal expression KeyPgAsAs DataTypedatatype ) KeyPgAsAs KeyPgSingleSingle

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

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

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

Return Value
	A KeyPgSingleSingle precision value.

Description
	The CSng function returns a 32-bit KeyPgSingleSingle value. The function does not 
	check for an overflow, so be sure not to pass a value outside the 
	representable range of the KeyPgSingleSingle data type. The name can be explained 
	as 'Convert to SiNGle'.

	If the argument to CSng is a string expression, it is first converted to 
	numeric by using KeyPgValVal.

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

	'Create an SINGLE variable
	Dim numeric_value As Single

	'Convert a numeric value
	numeric_value = CSng(-12345.123)

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

Differences from QB
	* The string argument was not allowed in QB

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

