ActiveX: SLLogX (Filename: SLLOGX.OCX)
![]()
| SLLogX is an ActiveX control that can be used to create and handle text log files. The log control can for example be used for storing real-time statistics or for locating errors in applications. |
Properties
| Name | Type | Description |
| Activated | Boolean | Activates/deactivates the log
functions in this control. If this property has the value False all
calling of the SLLogX methods
will be ignored. If this property has the value True all methods
can be used. With this property you can activate and deactivate log
handling in your application in an easy way. |
| CommentPrefix | String | Specifies a text string that
should be placed at the beginning of a comment row. The default value for
this property is "// ", but you can use any prefix you want. |
| DateAtLineBegin | Boolean | Determines if a date stamp
should be inserted at the beginning of a line with log data. |
| DateFormat | String | Specifies the format of dates
used in the log file. |
| FileName | String | Specifies the filename and path
to the current log file. |
| IsOpen | Boolean | Indicates if the log file is
open or closed. If this property has the value True the log file is
open for writing. |
| LogTitle | String | Specifies a log title that
should be added at the beginning of the log file. |
| TimeAtLineBegin | Boolean | Determines if a time stamp
should be inserted at the beginning of line with log data. |
| TimeFormat | String | Specifies the time format used
in the log file. |
Methods
Before you can add any rows to a log file you must open it with the Open
method. When you have finished adding data to the file
you must close it with
the Close method. All methods, except for GetLastError,
returns False if an error occurs and True if there
are no errors.
|
OpenAppend
() As Boolean Close
() As Boolean |
AddBlankLine () As Boolean Adds a blank line to the log file. AddComment
(Comment As String) As Boolean AddLine
(Line As String) As Boolean AddSeparatorLine
() As Boolean AddText
(Text As String) As Boolean AddWindowsVersion
() As Boolean
GetLastError () As Long |
Example
SLLogX1.FileName =
"C:\Windows\Test.log"
' Specify a filename to the log file
SLLogX1.LogTitle = "Log File Title"
' Specify a log file
title
If SLLogX1.Open Then
' Open a log file for writing
SLLogX1.AddComment "This is a comment"
' Add a comment to the
log file
SLLogX1.AddLine "This is a line with log information"
' Add a line with data
to the log file
SLLogX1.Close
' Close log file
End If
![]()