|
-
Oct 14th, 2000, 05:56 AM
#1
Thread Starter
Lively Member
Hi guys,
I have a logging function that will log anything i choose to the logfile, i have a bit of a problem with it..
all it does is use PRINT #File to output to the file..
the logfile will print to a certain point (halfway through a line) then stop, until i close my program.. it goes thru the print statement, i checked.. it just wont do it immediately... anyone know a solution.. code is below for my log function btw..
Code:
Public Function do_log(message As String)
If Not NOLOG Then Print #LogFile, Format(Date, "mm/dd/yyyy") & " " & Format(Time(), "hh:nn:ss") & " " & message
End Function
Ok, update, It now doesnt output _anything_ until i close the form.. (it did before, just missed about 3 lines) any ideas?
[Edited by CAPHS on 10-14-2000 at 07:03 AM]
Daniel Rose
VB 5.0 Enterprise.
irc:irc2.dynam.ac
If TheCodeInTheSig() Is Not Lame() Then IDontKnowWhatIs()
-
Oct 14th, 2000, 06:01 AM
#2
Frenzied Member
Did you use the open and close #LogFile? this will close the file, it writes immediatly in my case!
Close #filenumber > will only close the specified filenumber
Close > will close all the open files.
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 14th, 2000, 06:06 AM
#3
Thread Starter
Lively Member
i didnt use close yet, no, because i open LogFile at the very start of my prog, and it remains open throughout.. so i can simply call the function anytime(this isnt a big problem, i just noticed it and want to fix it if i can) i figure it must be that i dont close it between each right eh?
Daniel Rose
VB 5.0 Enterprise.
irc:irc2.dynam.ac
If TheCodeInTheSig() Is Not Lame() Then IDontKnowWhatIs()
-
Oct 14th, 2000, 09:01 AM
#4
it may depend on the method you have used to open the file in the first place. If you use the Locked / Read Write keywords, or you have done a combination of these, then you may not be able to open the file (in notepad for example) until you have used the close statement.
-
Oct 14th, 2000, 06:36 PM
#5
Printer.EndDoc will cause printing to start immediately.
-
Oct 14th, 2000, 07:39 PM
#6
Frenzied Member
hehe Marty, we're talking about 'printing' to a file.. you know 
CAPHS, yeah, when you don't use close, you don't notice any updates in the file I think, until you do close #fn.
Hope you got it to work now (damn I drink to much!)
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 14th, 2000, 09:31 PM
#7
Oops
-
Oct 21st, 2000, 04:11 AM
#8
Lively Member
Ever considered using a database as a log? U definitely have other parameters to upkeep?
-
Oct 21st, 2000, 05:04 AM
#9
Monday Morning Lunatic
It seems like your buffering's getting confused. VB has told Windows to write the data, but it hasn't sent enough, so the buffer needs to be flushed...not that I know how...
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|