I have a procedure that expects a parameter of type TObject, something like this:
MyProcedure (const AValue : TObject);
I have an array of Variant that I'm looping through to call the procedure, something like this:
for i:=0 to High(myArray) do
MyProcedure (myArray[i]);
The compiler gives an error saying: "Incompatible types: TObject and Variant".
What can I do to get around this?
More information: Up until now, I have been passing simple types (strings, numbers, dates) in variant arrays (the arrays are typically a mix of different types -- I'm eventually passing them as parameters to a database stored procedure). Now I need to also (in certain cases) pass a TObject.
What is the most appropriate data type/structure to pass the values, that can hold both simple types and objects? I guess I could create my own TParam type that has a field for both, but I am not sure of the exact syntax. Anyone has an example of this?