Hi there,
I have a general log-class which I use for logging a number of different structures.
One of the things I log is the following Struct
When I try to write this to a file I get
FilePut(iFilNr, LogItem, iWritePos)
it wont compile
FYI, this is not the only Struct I plan to log. I might even try to log some class-object. Thats why I used LogItem as Object
I stand as confused as a haytap between two donkeys
Any suggestions?
/Kejpa
I have a general log-class which I use for logging a number of different structures.
Code:
Public Sub Add2Log(ByVal LogItem As Object, Optional ByVal TimeStamp As Double = -1)
<snip>
FilePutObject(iFilNr, LogItem, iWritePos)
iWritePos += Len(LogItem)
FilePut(iFilNr, iWritePos, 1)
<snip>
End Sub
Code:
Public Structure CanLoggFormat
Public Nodid As Byte 1-127
Public SyncTime As Integer ms since OS started rollover every 49 days
Public Value1 As Short +/-30000
Public Value2 As Short +/-30000
Public Value3 As Short +/-30000
End Structure
But if I try to change the line toSystem.ArgumentException: FilePutObject of structure CanLoggFormat is not valid. Use FilePut instead.
FilePut(iFilNr, LogItem, iWritePos)
it wont compile
Public Overloads Sub FilePut(FileNumber As Object, Value As Object, [RecordNumber As Object = -1]) is obsolete: Use FilePutObject to write Object types, or coerce FileNumber and RecordNumber to Integer for writing non-Object types
FYI, this is not the only Struct I plan to log. I might even try to log some class-object. Thats why I used LogItem as Object
I stand as confused as a haytap between two donkeys
Any suggestions?
/Kejpa