Log Build ( help with ur code)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Frank R. Jr.

    Log Build ( help with ur code)

    hey man thanks for the code except i am getting a error at this line with
    the 1 by it

    Private Sub Form_Load()
    Dim strTMP As String ' declare the variable to hold the text
    strTMP = "The form is loading" ' fill with text
    'call the sub writeLog and send with it the text
    Call writeLog(strTMP )
    End Sub


    Private Sub writeLog(strLog As String)
    Dim nFile As Byte 'declare the variable to hold the file
    nFile = FreeFile 'get the available file number
    'open the file "aim.log" so we can write to it.
    1 Open App.Path & "\" & aim & "aim.log" For Output As n%
    'write to the file , the time-date, a comma, and strLog.
    Print nFile, CStr(Now) & " " & logItem
    Close n% 'close the file
    End Sub



    --
    Frank R. Jr.


  • J French

    #2
    Re: Log Build ( help with ur code)

    On Fri, 1 Oct 2004 20:39:54 -0500, "Frank R. Jr."
    <blahblah@hotma il.com> wrote:
    [color=blue]
    >hey man thanks for the code except i am getting a error at this line with
    >the 1 by it
    >
    >Private Sub Form_Load()
    >Dim strTMP As String ' declare the variable to hold the text
    >strTMP = "The form is loading" ' fill with text
    >'call the sub writeLog and send with it the text
    >Call writeLog(strTMP )
    >End Sub
    >
    >
    >Private Sub writeLog(strLog As String)
    >Dim nFile As Byte 'declare the variable to hold the file
    > nFile = FreeFile 'get the available file number
    > 'open the file "aim.log" so we can write to it.
    > 1 Open App.Path & "\" & aim & "aim.log" For Output As n%[/color]
    Open App.Path & "\" & aim & "aim.log" For Output As nFile[color=blue]
    > 'write to the file , the time-date, a comma, and strLog.
    > Print nFile, CStr(Now) & " " & logItem
    > Close n% 'close the file
    >End Sub[/color]

    Also I would not Dim nFile as a Byte

    See the Help File on the Open Statement

    Comment

    Working...