I'm wanting to save the value of a timer to a simple .txt file (add to the bottom). How can I do this using a script?
Thanks for reading and all all help is appreciated.
Thanks for reading and all all help is appreciated.
If this is your first visit, be sure to check out the FAQ. You must register before you can post.
IMPORTANT: Your first post will be checked for appropriate content. This may take a bit of time.
Public Sub Main(ByVal Parms As Object) Dim strFileName As String = "simple.txt" Dim strData As String = hs.DeviceString(nnnn) 'where nnnn is the Ref ID of the timer device Dim fApnd As Object Dim oFS As Object Dim ForAppending As Integer = 8 oFS = CreateObject("Scripting.FileSystemObject") fApnd = oFS.OpenTextFile(strFileName, ForAppending) fApnd.WriteLine(strData) ' add data fApnd.close() ' Close the file fApnd = Nothing oFS = Nothing End Sub
Comment