Question:
How can I delete records from a historic?
Solution:
To do so, use the ClearHistoricalData() function of the desired historic (via scripts).
If there is any object using the historic’s *.dat file (for example: a browser displaying its values), you must make sure this object’s file path is untied before ClearHistoricalData() command is executed.
Example: the script below illustrates how to delete data from Hist1, whose values are displayed at the screen’s Browser1:
Browser1.Query.filename = “” // Loads an empty field into the browser’s query
Browser1.UpdateQuery() // Updates changes in the browser
Hist1.ClearHistoricalData() // Erases records from Hist1
Browser1.Consulta.filename = “D:\TEMP\hist.dat” // Loads the correct path for querying the browser
Browser1.UpdateQuery() // Updates changes in the browser
Browser1.UpdateQuery() // Updates changes in the browser
Hist1.ClearHistoricalData() // Erases records from Hist1
Browser1.Consulta.filename = “D:\TEMP\hist.dat” // Loads the correct path for querying the browser
Browser1.UpdateQuery() // Updates changes in the browser