sx_GetLong

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_GetLong

VB Declaration

Declare Function sx_GetLong Lib "Apollo9.dll"

(ByVal cpFieldName As String)

As Long

C Declaration

LONG FAR PASCAL sx_GetLong

(BYTEP cpFieldName);

Description

Extracts the contents of a numeric field as a signed long integer value. Long integer range is

-2,147,483,648 to 2,147,483,647.

Note: Many of the sx_Get* functions can be replaced with a single call to sx_GetVariant. The sx_Get* functions that return specific data types are primarily for C programmers who cannot use sx_GetVariant.

Parameters

cpFieldName: The name of the field.

Return Value

The contents of the field converted to a signed long integer value.

VB Example

Sub List1_DblClick ()

Dim FldName As String

Dim dVal As Double

 

FldName = RTrim$((List1.Text))

If Len(FldName) > 0 Then

If sx_FieldType(FldName) = "N" Then

BoxInt.Text = Format$(sx_GetInteger(FldName), "00000")

BoxLong.Text = Format$(sx_GetLong(FldName), "0000000")

dVal = sx_GetDouble(FldName)

BoxDouble.Text = Format$(dVal, "000#.00")

End If

BoxString.Text = sx_GetString(FldName)

If sx_FieldType(FldName) = "D" Then

BoxDate.Text = sx_GetDateString(FldName)

Else

BoxDate.Text = ""

End If

...

End If

End Sub

C Example

LONG lValue;

lValue = sx_GetLong("serial");

See Also

sx_GetDouble, sx_GetInteger