Writes an item to the D3 file associated with the clsD3File object, overwriting the previous contents of the item.
object.brWrite oDynArrayItem, sItemName, [ vColumn], [ bLocking]
| Parameter | Description |
|---|---|
| object | An object variable that represents a clsD3File object. |
| oDynArrayItem | An object variable that represents a clsD3DynamicArray object that contains the item to be written. |
| sItemName | A String specifying the item-id of the item to write. |
| vColumn | Optional and not recommended. Provided only for legacy applications.
A Variant specifying either the attribute-defining item or the attribute
number. Note: To write a specific attribute on an item in a D3 file,
use, instead, the brWriteV or brWriteVU method.
|
| bLocking | Optional and not recommended. Provided only for legacy applications.
A constant indicating whether to keep the update lock set, as specified
in Settings. The default is d3Item_WriteUnLock. Note: To write an item with locking, use, instead, the brWriteU method.
|
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.brWriteaTask, 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
write