Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

LOG Files
[ All Languages » VB »  Api]

Total Hit ( 2681)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


Click here to copy the following block
'Just place this in a Module and you can call it from anywhere in your program!

Sub SetLog(Message As String)
'This Sub writes to a LOG file.
Dim theFile As String, theMessage As String
theFile = App.Path & "\PRGMLOG.TXT"
theMessage = Message & vbCrLf
Open theFile For Append As #1
Print #1, theMessage
Close #1
End Sub

'To use the above function, just call SetLog("The message to write in the log").

'Considering that it is a log file, you may want to replace the log each time... To do this, 'just call the next function. It will delete the existing Log (if it does exist).

Sub KillLog()
'This sub deletes the old LOG file
On Error Resume Next 'err check on
Kill App.Path & "\PRGMLOG.TXT" 'Delete log
On Error GoTo 0 'err check off
End Sub

'To use the above function, just call KillLog.


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.