Function File Operations Class

DebugMessage

Append a message to a "log" file, preceded by the current date and time. Function returns True upon success and False upon failure.

Signature (Visual Basic / VBA)

Public Function DebugMessage( _
      ByVal vFileName As Variant _
    , ByVal vMessage As Variant _
    ) As Boolean

Code Examples

    ? DebugMessage(Null, "Something.")
    True
    ? FileToString("debug.out")
    1996/06/27 09:36:21: Something.

Parameters

Parameter Description
vFileName Name of the file to which the date/time and message will be appended. vFileName defaults to "debug.out" if it is Null or cannot be fixed-up to a string. The named file will created if it does not already exist.
vMessage Optional message that will be appended to the file. vMessage defaults to "(No message.)" if it is Null or cannot be fixed-up to a string.

Notes & Version History

Note This function writes an extra blank line to the file the before it write its first message.