Hello,
I am storing the variables( cog and angle) in a seperate notepad using vb program. I need to refresh notepad(i.e delete all the values and again start to write the values) for every certain amount of time say 10 sec.
So after every 10 sec, I need to delete all the previous values and start storing new values.
Any help regarding how to implement?
Code for writing into notepad.
Dim fi
Dim fso
Dim intVar
set fso = CreateObject("Scripting.FileSystemObject")
set fi = fso.OpenTextFile("c:\text.txt", 8, true)
intVar = 1
if err.number = 0 then
' Append the cog coordinates to the file.
' You can specify other variables here
intVar = intVar+1
fi.writeLine intVar & "." & GetVariable("X_1") & ":" & GetVariable("Y_1") & ", " & GetVariable("X_2") & ":" & GetVariable("Y_2") & "," & GetVariable("X_3") &":"& GetVariable("Y_3") & "," & GetVariable("X_4") & ":" & GetVariable("Y_4")
fi.writeLine "Angle_1:" &GetVariable("Angle_1") &"," & "Angle_2:" & GetVariable("Angle_2") & "," & "Angle_3:" & GetVariable("Angle_3") & "," & "Angle_4:" & GetVariable("Angle_4")
fi.close
end if
set fi = nothing
set fso = nothing
|
|