sx_Empty

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_Empty

VB Declaration

Declare Function sx_Empty Lib "Apollo9.dll"

(ByVal cpFieldName As String)

As Integer

C Declaration

BOOL FAR PASCAL sx_Empty

(BYTEP cpFieldName);

Description

Determines whether or not the named field is empty.

Parameters

cpFieldName: The name of the field.

Return Value

True if the field contents are empty, and False if not. Character and date fields are considered empty if they consist of spaces. Numeric fields are empty if they evaluate to zero. Logical fields are empty if they evaluate as False. Memo fields are empty if the memo block reference evaluates to zero.

VB Example

Sub Brw1_Change (nRowCol As Integer)

' whenever rec no changes, dynamically display memo & details

If nRowCol <> BRW_CHANGE_COL Then

If sx_Empty("notes") Then

tMemo.Text = ""

Else

tMemo.Text = sx_GetMemo("notes", 0)

End If

tLast.Text = sx_GetTrimString("last")

tCity.Text = sx_GetTrimString("city")

tCountry.Text = sx_GetTrimString("country")

tPhone.Text = sx_GetTrimString("ph_voice")

End If

End Sub

C Example

void CNamesForm::OnChangeSdeb1(UINT, int, CWnd*, LPVOID lpParams)

{

SHORT iRowCol = AFX_NUM_EVENTPARAM(short, lpParams);

if (iRowCol != BRW_CHANGE_COL)

{

if (sx_Empty("notes"))

m_memo->SetStrProperty("Text", "");

else

m_memo->SetStrProperty("Text", sx_GetMemo("notes", 0));

}

}