sx_SetExact

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_SetExact

VB Declaration

Declare Sub sx_SetExact Lib "Apollo9.dll"

(ByVal uiOnOff As Integer)

C Declaration

VOID FAR PASCAL sx_SetExact

(USHORT uiOnOff);

Description

Indicates whether or not Seeks are to return True if a partial key match is made.

Parameters

uiOnOff: If True, key searches made with sx_Seek must match exactly in content and length. Partial key matches will result in False returns from sx_Seek.

 

If False, the exact condition is turned off.

 

The sx_SetExact setting is applied to all index seeks in the current task. It is global to the current task.

Note: If sx_SetSoftSeek is set to True, the sx_SetExact setting is disabled.

VB Example

Sub ButtonSeek_Click ()

RecStr$ = InputBox$("Seek Key?", "Seek", "")

If RecStr$ = "" Then Exit Sub

sx_SetExact True ' key must match in content and length

If sx_Seek(UCase$(RecStr$)) Then

Call sx_GetRecord(lRec)

BoxCust.Text = lRec.lCust

Else

MsgBox "Key Not Found"

ButtonTop_Click

End If

sx_SetExact False

End Sub

C Example

sx_SetExact(TRUE); // key must match in content and length

if (sx_Seek(cpKey))

sx_GetRecord(cpRec);

else

AfxMessageBox((LPCSTR) "Key Not Found");

sx_SetExact(FALSE);

See Also

sx_Seek, sx_SetSoftSeek