brFileUnlock method

Releases a previously set lock on the D3 file associated with the clsD3File object.

Syntax

object.brFileUnLock

The object variable represents a clsD3File object.

Remarks

Only the clsD3File object that locks the file can unlock the file.

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

fileunlock

Applies to

clsD3File class