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:
The name for the control that will be displayed in the report.
The order in which the controls will be displayed in the reports. This property is only available for IDEA version 10 or higher. Do not change it if you plan to use the dialog for a lower version of IDEA.
Defines whether or not the output of the control is stored when the parent dialog is closed. Its default value is "True". In case this property is set to "False" the save routine of SmartAnalyzer is not storing the data entered into the corresponding input control."True" means the data will be stored and is available when opening the dialog a second time. This property is only available for IDEA version 10 or higher. Do not change it if you plan to use the dialog for a lower version of IDEA.
If set to true the control will be shown in the report. This property is only available for IDEA version 10 or higher. Do not change it if you plan to use the dialog for a lower version of IDEA.
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