I would like to have a function that accepts a string dictionary, an array of options. Therefore, it can be called using:
searchDictionary := TDictionary<string, array of variant>;
searchDictionary.Add('KEY_NAME', ['X01%', '%D01']);
aValue := TDtoClass.Search(searchDictionary)
I am currently achieving this
searchDictionary := TDictionary<string, TList<variant>>.Create;
searchDictionary.Add('BIN_NAME', TSearch.Values(['X01%', '%D01']));
where Tsearch is a class that provides:
class function TSearch.Values(const arguments: array of variant): TList<variant>;
var
list : TList<variant>;
item: variant;
begin
list := TList<variant>.Create;
for item in arguments do
begin
list.Add(item);
end;
Result := list;
end;
What I would like to do:
searchDictionary.Add('BIN_NAME', ['X01%', '%D01']);
instead:
searchDictionary.Add('BIN_NAME', TSearch.Values(['X01%', '%D01']));
Any help would be greatly appreciated.
source
share