brFileLock method

Sets an exclusive lock on the D3 file associated with the clsD3File object.

Syntax

object.brFileLock

The object variable represents a clsD3File object.

Example

Private Sub UpdateLog(oConn As clsD3Connection, aTask As clsD3DynamicArray)
   Dim oFile As clsD3File
   Dim sLogName As String
   Dim aItem As New clsD3DynamicArray
   Dim sItemName As String
 
   On Error GoTo D3ErrorHandler
 
   sLogName = "daily" & oConn.brDate & ".log"
   Set oFile = oConn.brOpenFile(sLogName)
 
   oFile.brFileLock
   ' Item-id will be the time.
   sItemName = oConn.brTime
   oFile.brWrite aTask, sItemName
 
   oFile.brFileUnlock
 
   oConn.brCloseFile oFile
Exit Sub
 
D3ErrorHandler:
   Select Case Err.Number
      Case d3SrvErr_Missing
         oConn.brCreateFile "", sLogName, 3, 31
   Case Else
      End
   End Select
   Resume
End Sub

FlashBASIC reference

filelock

Applies to

clsD3File class