Results 1 to 3 of 3

Thread: Code: LogFile

  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Code: LogFile

    <pre>Public Function LogFile(strFile As String, strMsg As String)
    ' Procedure : LogFile
    ' Description: Time stamp a message string to a file.
    ' Copyright: Chris Greaves Inc.
    ' Inputs: The local or full file name, a string.
    ' Returns: None.
    ' Assumes: None.
    ' Side Effects: None.
    ' Tested: By the calls shown below.
    Dim strDateTime As String
    strDateTime = Format(Now(), "yyyymmdd") & ";" & Format(Now(), "hhmmss") & ";"
    Call PrintFile(strFile, strDateTime & strMsg)
    'Sub TESTLogFile()
    ' stored in macroContainer folder
    ' Call LogFile("erase.txt", "Here is a first message")
    ' stored in boot root folder
    ' Call LogFile("c:erase.txt", "Here is a second message")
    ' Call LogFile(MacroContainer.Path & Application.PathSeparator & "erase.txt", _
    "Here is a third message")
    'End Sub
    End Function

    </pre>


  2. #2
    kelliel
    Guest

    Re: Code: LogFile

    Thanks for this code. I was going to work something up, just out of curiosity; and now I can just "steal" your code. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    Again, thanks

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Code: LogFile

    It's what it's there for.



    (Actually I view the lounge as a testing-ground for ideas and code. And you don't steal it, you "beta-test" it!)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •