CasewareDocs

SmartDataExchanger

Can be used for exchanging data between a macro and its dialog.

Possible use case:

An audit test shall detect all rows of an IDEA database which are belonging to specific entities. The dialog gets a distinct list of all entities.

Return values: list of selected entities.

Reporting value: all return values.

Properties:

Example

fill from macro:

Dim dictionary As Object

Set dictionary = SmartContext.MacroCommands.SimpleCommands.CreateHashtable

dictionary.Add "input", "some text" ' any simple type can be used

args.Inputs.Add "sde", dictionary 'is the is the name of the control in the dialog

usage in dialog:

private void MacroFrom_Load(object sender, EventArgs e)

{

if (sde.value.Contains("input"))

{

this.Text = sde.Value["input"].ToString();

}

}

setting from dialog:

private void Button_OK_Click(object sender, EventArgs e)

{

sde.Value.Clear();

sde.Value.Add("output", 3.14);

}

usage of output from macro:

set result = dialogInvoker.PerformTask("Test2", args)

if result.AllOK then

if result.Outputs.Contains("sde") then

set dictionary = result.Outputs.Item("sde").Value

if dictionary.Contains("output") then

MsgBox "Dictionary output = " & dictionary.Item("output"), MB_OK, "Title"

end if

end if

end if