CasewareDocs

SetParameters

Assigns a collection of execution parameters to the current execution record (association between audit test and IDEA table).

Compatibility

Available as of IDEA version 12.0

Syntax

SetParameters(parameters As Array)

Parameters

parameters

Array of parameters’ values. Type if array item is Object (VARIANT).

Remarks

If the execution record is not available, an exception is thrown.

In order to obtain the collection of parameters to pass as the method’s argument, the following options are available:

  • Use the .Parameters property of Audit Test Accessor component. Execution record is not required. The value of .Value property of each item is empty and has to be set;
  • Use the .Parameters property of Audit Test Executor component. In this case, execution record is required. The value of .Value property of each item contains current value of execution parameter;

Example

Sub Main()
Dim SA
Dim atExecutor
Dim atAccessor
Dim parameters
Dim paramCheckBox1
Dim paramSingleList1
Set SA = CreateObject("SmartAnalyzer.AutomationClient")
atId = "f4d65220-77f1-5969-8943-59c7bd448460"
tblName = "Sample-Weblog"
' --- Obtain logical parameters from AT Accessor and set values ---
Set atAccessor = SA.GetAT(atId)
Set parameters = atAccessor.Parameters
Set paramCheckBox1 = parameters.Get("smartCheckBox1")
Set paramSingleList1 = parameters.Get("smartSingleList1")
paramCheckBox1.Value = True
listValues = Array("Potato","Tomato","Cucumber")
paramSingleList1.Value = listValues
' ----------------- Create exec record ---------------------
Set Tagging = SA.GetTagging(tblName)
Tagging.SetTag "Comment", "SITE"
Tagging.Save True
' ----------------- Assign parameters to exec record ---------------------
Set atExecutor = atAccessor.GetAtExecutor(tblName)
atExecutor.SetParameters(parameters)
' --- Obtain physical parameters from AT Executor and display values ---
Set parameters = atExecutor.Parameters
Set paramCheckBox1 = parameters.Get("smartCheckBox1")
Set paramSingleList1 = parameters.Get("smartSingleList1")
MsgBox"New value of chexbox1: " & paramCheckBox1.Value
FOR EACH v IN paramSingleList1.Value
MsgBox"Next new value of singleList1: '" + v + "'"
NEXT
End Sub

 

When executed, this script produces the following output sequence:

New value of chexbox1: True

Next new value of singleList1: 'Potato'

Next new value of singleList1: 'Tomato'

Next new value of singleList1: 'Cucumber'