CasewareDocs

RemoveHistoryKeep

Deletes all history rows of an IDEA database except the first n.

Compatibility

Available as of IDEA version 9.0

Syntax

RemoveHistoryKeep(databaseName as String, count as Integer)

Parameters

databaseName

The name or the path of an IDEA database.

count

The number of elements to be kept.

Remarks

An error is raised if databaseName cannot be found or the parameter is empty.

Example

Dim ProtectIP As Object 
Dim fileName As String
Dim countAtTheBeginning As Long

Sub Main
'Get the name of the database.
fileName = SmartContext.PrimaryInputFile

'Initialization
Set ProtectIP = SmartContext.MacroCommands.ProtectIP

'Get history count for a database
countAttheBeginning = ProtectIP.HistoryCount (fileName)

'Do some operations based on assigned database
...
...

'Delete history entries added during macro execution
ProtectIP.RemoveHistoryKeep fileName, countAtTheBeginning

'Release objects.
Set ProtectIP = Nothing
End Sub
RemoveHistoryKeep | Caseware Docs