sx_SetLockTimeout

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_SetLockTimeout

VB Declaration

Declare Sub sx_SetLockTimeout Lib "Apollo9.dll"

(ByVal iSeconds As Integer)

Description

Sets the number of seconds allowed to retry a lock operation before failing.

Parameters

iSeconds: The lock operation will be continuously retried for this number of seconds before reporting failure. The default value is 1 second.

 

If this is set to 0, a failed lock will return False immediately.

VB Example

' Main form contains init calls

Sub Form_Load ()

Dim iRet As Integer

 

sx_CloseAll

sx_SetDateFormat ANSI

sx_SetCentury True

sx_SetDeleted True

iRet = sx_SetHandles(30)

sx_SetLockTimeout 5

sxbmain.Caption = "Version " + sx_Version()

 

If Dir$("c:\data\sxlog.dbf") = "" Then

MsgBox "File Not Found"

End

End If

LogArea = sx_Use("c:\vb\sxlog.dbf", "sxlog", READWRITE, SDENTX)

LogIndex1 = sx_IndexOpen("c:\vb\sxlog1.ntx")

LogIndex2 = sx_IndexOpen("c:\vb\sxlog2.ntx")

 

BoxSelect.Text = Format$(LogArea, "00")

BoxCount.Text = Format$(sx_RecCount(), "#####0")

Call sx_GetRecord(lRec)

BoxCust.Text = lRec.lCust

BoxName.Text = lRec.lName

BoxRecno.Text = Format$(sx_RecNo(), "###0")

 

' database info

BoxCA.Text = sx_WorkArea(0&)

BoxFN.Text = sx_BaseName()

BoxAN.Text = sx_Alias(0)

BoxLU.Text = sx_BaseDate()

BoxRS.Text = sx_RecSize()

End Sub

See Also

sx_Flock, sx_Locked, sx_Rlock, sx_Unlock