Skip to content

CULNG


Converts numeric or string expression to Ulong

Syntax

vb
declare function Culng ( byval expression as datatype ) as ulong

Type typename

declare operator cast ( ) as ulong

End Type

Usage

vb
result = Culng( numeric expression )
result = Culng( string expression )
result = Culng( user defined type )

Parameters

expression

a numeric, string, or pointer expression to cast to a Ulong value

datatype

any numeric, string, or pointer data type

typename

a user defined type

Return Value

A Ulong value.

Description

The Culng function rounds off the decimal part and returns a 32 bit Ulong value. The function does not check for an overflow. The name can be explained as 'Convert to Unsigned LoNG'.

If the argument is a string expression, it is converted to numeric by using Valuint or Valulng.

Examples

start GeSHi

vb
' Using the CULNG function to convert a numeric value

'Create an UNSIGNED LONG variable
Dim numeric_value As ULONG

'Convert a numeric value
numeric_value = CULng(300.23)

'Print the result = 300
Print numeric_value
Sleep

end GeSHi

Dialect Differences

  • Not available in the -lang qb dialect unless referenced with the alias __Culng.

Differences from QB

  • New to FreeBASIC

See also

  • Cbyte
  • Cubyte
  • Cshort
  • Cushort
  • Cint
  • Cuint
  • Clng
  • Clngint
  • Culngint
  • Csng
  • Cdbl

Back to DocToc

Translated from FreeBASIC official docs. Contact us for removal if infringed.
FreeBASIC is an open-source project, not affiliated with Microsoft