Revision [9928]

This is an old revision of KeyPgClng made by JeffMarshall on 2007-07-24 05:37:56.

 

CLNG


Converts numeric or string expression to KeyPgLong Long having the same size as KeyPgSizeof Sizeof(KeyPgAny Any KeyPgPtr Ptr)

Syntax:
Usage:
result = Clng( numeric expression )
result = Clng( string expression )
result = Clng( user defined type )

Parameters:
expression
a numeric, string, or pointer expression to cast to a KeyPgLong Long value
datatype
any numeric, string, or pointer data type
typename
a user defined type

Return Value:
A KeyPgLong Long value.

Description:
The Clng function rounds off the decimal part and returns a 32 bit KeyPgInteger Integer or 64 bit KeyPgLongint Longint value. The function does not check for an overflow. The name can be explained as 'Convert to LoNG'.
If the argument is a string expression, it is converted to numeric by using KeyPgValint Valint or KeyPgVallng Vallng.
Long has the same size as KeyPgSizeof Sizeof(KeyPgAny Any KeyPgPtr Ptr).

Examples:

' Using the CLNG function to convert a numeric value

'Create an LONG variable
Dim numeric_value As Long

'Convert a numeric value
numeric_value = CLng(-300.23)

'Print the result, should return -300
Print numeric_value
Sleep


Differences from QB:
See also:
Back to Converting Data Types
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode