Results 1 to 4 of 4

Thread: Code: PrintFile

  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: PrintFile

    <pre>Public Function PrintFile(strFile As String, strMsg As String)
    ' Procedure : PrintFile
    ' Description: Print a message 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 intFile As Integer
    intFile = FreeFile
    Dim strWorkFile As String
    strWorkFile = strFile
    ' add an extent if there is not one yet.
    If InStr(1, strFile, strcExtentSeparator) > 0 Then
    Else
    strWorkFile = strWorkFile & ".txt"
    End If
    ' add a path if there is not one yet.
    If InStr(1, strFile, Application.PathSeparator) > 0 Then
    Else
    strWorkFile = MacroContainer.Path & Application.PathSeparator & strWorkFile
    End If
    Open strWorkFile For Append As #intFile
    Print #intFile, strMsg
    Close #intFile
    End Function
    </pre>


  2. #2
    kelliel
    Guest

    Re: Code: PrintFile

    This code has a variable in it, "strcExtentSeparator", which I cannot find defined.

  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: PrintFile

    You'll find it in here.

    This (attached) is my collection of declarations at the head of my module "U" in my utility template "Utils.dot".

    I create an application by saving Utils.dot with a new name, adding the application's module/form code, and then using Procedure Stripper to remove all unreferenced material. It's the fastest way I know to get something off the ground.

    You will see the strcApplication which is used to identify each application as it is developed. Since I want to compile the Utils.dot after making changes, i have to have that dummy strcApplication in there.

    The bad news for loungers is that I am so used to having the Public Const around, that I'll just type them straight in to a function without thinking.


    (later)

    Apologies to those who suffered my wide-screen.

    Late yesterday my head got screwed around the wrong way - Coriolis force of Friday again I suppose.

  4. #4
    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: PrintFile

    The attachment didn't seem to tak on the edit. here it is as a separate post.
    Attached Files Attached Files

Posting Permissions

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