CasewareDocs

Add

Adds a result to the result list provided by SmartAnalyzer.

Compatibility

Available as of IDEA version 9.0

Syntax

Add(value As Object)

Parameters

value

The object to be added.

Return Value

The method returns true if the result was added and false if the result already exists.

Remark

An exception is thrown if parameter is null.

Example

The following script adds the result file Result_1 to the collection of audit test result databases.

'Constants for UniqueFileName and CreateResultObject functions 
Const NOT_A_RESULT As Long = 0
Const INPUT_DATABASE As Long = 1
Const INTERMEDIATE_RESULT As Long = 2
Const FINAL_RESULT As Long = 4
Const NO_REGISTRATION As Long = 8

Dim SimpleCommands As Object
Dim ResultFileAs Object
Dim Result_1 As String

Sub Main
...
Result_1 = db.Name

'Create a result of final result type, visible in Report section.
Set SimpleCommands = SmartContext.MacroCommands.SimpleCommands

Const IsVisible = True
Const ReportSequence = 1
Set resultFile = SimpleCommands.CreateResultObject(Result_1, FINAL_RESULT, IsVisible, ReportSequence)

resultFile.ExtraValues.Add "ShortName", "Greater than 50'000"
resultFile.ExtraValues.Add "Description", "This result contains all transactions with amount greater than 50'000"
resultFile.ExtraValues.Add "ReportColumns", "a,b,c"
resultFile.ExtraValues.Add "RowCount", 10

'Add the result to the result collection.
SmartContext.TestResultFiles.Add resultFile

'Release objects.
Set resultFile = Nothing
Set SimpleCommands = Nothing
End Sub
Add | Caseware Docs