This property refers to the index of the current datasource retrieved by the List method.
Property Value
The DataSourceIndex value is the index of the current datasource retrieved by the List method
Explanation
The DataSourceIndex property refers to the index of the current datasource retrieved by the List method.
If this property is -1, the List method has failed. If this property is 0 or above, the array of datasources can be accessed by the DataSourceNameList. Strings property. For more information about TStrings, please refer to Delphi or C++Builder help documentation.
The DataSourceIndex property corresponds to the Scan Control's ScanDsNameCount property in earlier versions of the ImageKit.
Example Code
In C++Builder
bool Ret;
Ret = VImageKit1->Scan->List();
if (Ret == false ||
VImageKit1->Scan->DataSourceNameList->Count == 0)
return;
ComboBox1->Items =
VImageKit1->Scan->DataSourceNameList;
ComboBox1->ItemIndex =
VImageKit1->Scan->DataSourceIndex;
In Delphi
Ret: Boolean;
Ret := VImageKit1.Scan.List;
if (Ret = False) or (VImageKit1.Scan.DataSourceNameList.Count = 0)
then Exit;
ComboBox1.Items := VImageKit1.Scan.DataSourceNameList;
ComboBox1.ItemIndex := VImageKit1.Scan.DataSourceIndex;
Setting this value
This value cannot be set.
Retrieving this value
This value can be retrieved at runtime.
Differences with ImageKit 7/8/9/10 ActiveX
The DataSourceNameList property name has been changed from
DsNameList.
Since the current data source is not added to the beginning of the
DataSourceNameList property, use the DataSourceIndex property to
get the name of the current data source.