I am stuck with that crazy variant type that came from Delphy.
here is a simple ex. from help:
<ex>
int C;
AnsiString A;
Variant V;
V = Table1->Lookup("Company;State",
VarArrayOf(OPENARRAY(Variant, ("Blue Sports","OR")),
"CustNo;Addr1"
if !(VarType(V) == varNull)
{
C = V[0];
A = V[1];
ShowMessage(IntToStr(C) + #10 + A);
}
else
ShowMessage("Search unsuccessful!"
</ex>
Everytime I receive an exeption : Cant convert AnsiString to Variant.
What is going on?
Can someone give a simple ex. how to use TTable->Lookup?
Thanks clifff.
here is a simple ex. from help:
<ex>
int C;
AnsiString A;
Variant V;
V = Table1->Lookup("Company;State",
VarArrayOf(OPENARRAY(Variant, ("Blue Sports","OR")),
"CustNo;Addr1"
if !(VarType(V) == varNull)
{
C = V[0];
A = V[1];
ShowMessage(IntToStr(C) + #10 + A);
}
else
ShowMessage("Search unsuccessful!"
</ex>
Everytime I receive an exeption : Cant convert AnsiString to Variant.
What is going on?
Can someone give a simple ex. how to use TTable->Lookup?
Thanks clifff.