vortexed Posted June 16, 2013 Author Share Posted June 16, 2013 I think I am missing something - sure FileOpen() gives you the ability to close the handle when ever you want. But how do I accomplish the following Some code.... "DATA 1 " some more code... "DATA 2" additional code... "DATA 3" the content inside the "" is what I want to capture inside a file called toto.txt. If I wanted to say store all the information inside "" inside a variable or maybe an array (your recommendations here) - so that I can then flush or write all the information inside the "" one time only. I'll need to be able to destroy the data inside the variable or array after I am done flushing it or writing it. I know that there are different ways to flush or write the data such as FileWrite() or FileWriteLog() etc.... What tool works best for my task is what I need help with. Link to comment Share on other sites More sharing options...
water Posted June 16, 2013 Share Posted June 16, 2013 Sorry, but I still don't understand why you need to write multiple log entries at once. It would be much easier to write a log entry when the "action" you want to log has occurred. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
vortexed Posted June 16, 2013 Author Share Posted June 16, 2013 The reason is that it's writing to a file across the network. I rather write once vs write multiple times. It conserves bandwidth and its a lot more functional. Link to comment Share on other sites More sharing options...
water Posted June 16, 2013 Share Posted June 16, 2013 Then use something like this: While 1 $sMessage = _Now() & " Test1" & @CRLF Sleep(2000) $sMessage &= _Now() & " Test2" & @CRLF Sleep(2000) $sMessage &= _Now() & " Test3" & @CRLF _LogToFile(@ScriptDir & "test.log", $sMessage) WEnd Collects all messages in a single variable and writes it to the log file at the end of the loop. Notice the "=" in the first assignment and "&=" in the rest. 0xdefea7 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now